(Novice, my first issue, follow-up from #1832870: Only show source translation column if there are 2 or more source languages (more than n/a and the original language).).
Problem/Motivation
The file content_translation.pages.inc contains a function that is marked as deprecated, and which is to be moved to ContentTranslationController::overview().
The file content_translation.pages.inc contains a function that is marked as deprecated(content_translation_add_page()), and which is to be moved to ContentTranslationController::add()
The file content_translation.pages.inc contains a function that is marked as deprecated(content_translation_edit_page()), and which is to be moved to ContentTranslationController::edit()
Move function _content_translation_get_switch_links() from content_translation.pages.inc to ContentTranslationController::getSwitchLinks()
Move function content_translation_prepare_translation() from content_translation.pages.inc to ContentTranslationController::prepare()
Proposed resolution
Move the code.
Remaining tasks
- Move the code
User interface changes
No UI changes.
API changes
No API changes.
Follow-up from #1832870: Only show source translation column if there are 2 or more source languages (more than n/a and the original language)..
| Comment | File | Size | Author |
|---|---|---|---|
| #33 | 2224607-33.patch | 21.12 KB | andrei.dincu |
| #27 | interdiff-25-27.txt | 3.14 KB | andrei.dincu |
| #27 | 2224607-27.patch | 21.08 KB | andrei.dincu |
| #25 | interdiff-20-25.txt | 3.85 KB | andrei.dincu |
| #25 | 2224607-25.patch | 21.11 KB | andrei.dincu |
Comments
Comment #1
mauzeh commentedComment #2
mauzeh commentedComment #3
andrei.dincu commentedmove content_translation_overview() body to ContentTranslationController::overview()
remove content_translation_overview()
Comment #4
andrei.dincu commentedComment #5
andrei.dincu commentedThere are already tests created for this at:
Drupal\content_translation\Tests\ContentTranslationUITest
Could not remove: module_load_include('pages.inc', 'content_translation');
because there are other functions from content_translation.pages.inc file that are called in the controller.
Comment #6
andrei.dincu commentedComment #7
andrei.dincu commentedI decided to move all functions from content_translation.pages.inc to the Drupal\content_translation\Controller\ContentTranslationController class.
Functions from content_translation.pages.inc are only used in the ContentTranslationController.
Furthermore, I will delete file content_translation.pages.inc.
I will remove @todo from comments for ContentTranslationController
Comment #8
andrei.dincu commentedComment #9
andrei.dincu commentedComment #10
andrei.dincu commentedComment #11
andrei.dincu commentedSolve all tasks specified in motivation.
Comment #12
andrei.dincu commentedComment #14
andrei.dincu commentedComment #15
andrei.dincu commentedComment #16
jibranThank you for the patch. Here are some minor issues.
I think this is for debugging. So we can remove it. You can use
debug()function in D8 instead of dsm();We can remove \Drupal usage in Controller and use constructor injections.
more then 80 chars.
Whitespace.
Comment #17
andrei.dincu commentedSmall improvements as specified in comment #16.
Comment #18
andrei.dincu commentedComment #19
jibranPlease post the interdiff.
We can use
$this->tinstead oft.more then 80 chars.
Comment #20
andrei.dincu commentedSolved issues from comment #19.
Provide interdiff.
Waiting for feedback.
Comment #21
andrei.dincu commentedComment #22
penyaskitoWow! This looks really awesome. Thanks for working on this, Andrei. Some small nitpicks:
Remove the trailing backslash.
The phpdoc first argument says that this is an entity, but it is not.
Add typehinting: add(Request $request, Language $source, Language $target). This way IDEs can help autocompleting.
We should use here fully-qualified namespaces, as the other methods' phpdoc. See https://drupal.org/coding-standards/docs#types
Wrong indentation.
Typo: entitiy => entity.
Comment #23
andrei.dincu commentedThank you penyaskito for you review.
I've fixed documentation.
Providin interdiff.
Waiting for you review again please.
Comment #25
andrei.dincu commentedComment #26
znerol commentedGreat progress, thank you very much andrei. Overall the patch looks great, some minor issues:
object is misspelled in several places.
A comma should be followed by a space in the argument list (also several places).
When type hinting, use an interface when possible. I.e. LanguageInterface instead of Language. A notable exception to this rule is the
Requestclass, there is no interface for it.Comment #27
andrei.dincu commentedSolved issues from the previous comment.
Providing interdiff.
Comment #28
znerol commentedThis looks okay now. Let's get it in and move on. Thank you andrei.
Comment #29
andrei.dincu commentedThank you for your review.
Comment #30
penyaskitoAdding to sprint
Comment #31
penyaskitoAnd tagging.
Comment #33
andrei.dincu commentedPatch rerolled
Comment #34
znerol commentedComment #35
Anonymous (not verified) commentedIt duplicates this one https://drupal.org/node/1987882. We need an authorized person who is able to take a right decision.
Comment #36
penyaskitoLet's postpone this one on the other one. When #1987882: Convert content_translation routes to a new style controller is done we can get back here and ensure that content_translation.pages.inc has been removed.
Comment #37
andypostThis already happens in #1987882: Convert content_translation routes to a new style controller
Comment #38
gábor hojtsyOff of the sprint then.