Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
While working on some translation features I went through translation.pages.inc and (1) added a lot of comments and (2) moved a few lines to give more sense.
The result is attached in a very simple patch.
(Backport for Drupal 6 is in a separate issue, #1045392: Code cleanup in translation.pages.inc (D6).)
Comment | File | Size | Author |
---|---|---|---|
#14 | translation_page_cleanup-1045396-14.patch | 5.84 KB | Sivaji_Ganesh_Jojodae |
#12 | translation_page_cleanup-1045396-11.patch | 5.83 KB | Sivaji_Ganesh_Jojodae |
#4 | translation_page_cleanup-1045396-4.patch | 5.92 KB | Itangalo |
translation-page-clarified-7.patch | 5.53 KB | Itangalo | |
Comments
Comment #1
Itangalo CreditAttribution: Itangalo commentedChanging to 'needs review'. Sorry for missing this.
Comment #3
Itangalo CreditAttribution: Itangalo commentedtranslation-page-clarified-7.patch queued for re-testing.
Comment #4
Itangalo CreditAttribution: Itangalo commentedOk, I've just learned how to use Git to create patches, according to the new style. Sweet.
Robot, please retest!
Comment #5
plachChanges are performed in the development version first, backported then.
Comment #6
plachComment #7
TR CreditAttribution: TR commentedI closed #1045392: Code cleanup in translation.pages.inc (D6) as a duplicate. This should be one issue, there's no need to discuss the same changes in two different threads. Once this issue is resolved in 8.x the issue status can be set to "needs backport" to port it to previous versions.
Comment #8
plach#4: translation_page_cleanup-1045396-4.patch queued for re-testing.
Comment #10
swentel CreditAttribution: swentel commentedA lot has been cleaned up in the D8 cycle, can move to D7 if we still want to clean this up.
Comment #11
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedPatch needs reroll.
Comment #12
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedHave re-rolled the previous patch with a change replacing lengthy ternary operators with if/else for better readability.
Comment #14
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedRerolled with proper fix!
Comment #15
TR CreditAttribution: TR commented14: translation_page_cleanup-1045396-14.patch queued for re-testing.
Comment #16
parthipanramesh CreditAttribution: parthipanramesh commentedLooks good!
Comment #17
David_Rothstein CreditAttribution: David_Rothstein commentedA good portion of this seems to apply to Drupal 8 - see content_translation_overview() (and \Drupal\content_translation\Controller\ContentTranslationController::overview(), which is a wrapper around that).
Also:
That else statement could just be removed, right?
Comment #26
quietone CreditAttribution: quietone as a volunteer commentedThe file changed here is not in Drupal 9.2.x. \Drupal\content_translation\Controller\ContentTranslationController::overview() has changed a lot since the last patch here. That makes this outdated for current HEAD.
The Drupal 7 files have not changed, so it may be applicable, but it is not a bug fix nor is there anything to backport. I think the sensible thing to do is to close this as outdated. I trust someone will change that if it is incorrect.