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.
Follow-up to #1938930: Convert theme_system_modules_details() to #type table
Please add these people to the commit message as they worked on it in the issue this was split from:
martin107, akalata, joelpittet, lokapujya, rpayanm, duellj, Hydra, amitgoyal, prajaankit
Task
Convert the following theme functions to use the new table #type:
Module | Theme function name | Where in Code | What is it really? |
---|---|---|---|
|
|
|
|
These 2 were removed or converted to twig in other patches.
Module | Theme function name | Patch |
---|---|---|
|
|
#2127941: Remove two (out of 3) bogus and duplicate date languages UIs |
|
|
#2151101: Convert theme_status_report() to Twig |
Related issues
Comment | File | Size | Author |
---|---|---|---|
#29 | 2507243-21.patch | 12.27 KB | jmolivas |
#25 | interdiff-2507243-21-22.txt | 3.25 KB | jmolivas |
#22 | interdiff-2507243-21-22.txt | 3.25 KB | jmolivas |
#22 | convert-2507243-22.patch | 14.15 KB | jmolivas |
#21 | interdiff-2507243-21.txt | 2.41 KB | lokapujya |
Comments
Comment #1
joelpittetHere's the split off from #1938930: Convert theme_system_modules_details() to #type table
Comment #3
lokapujyaSo, formatPlural needs safeMarkup into it?
Comment #5
lokapujyathere is 2 formatPlurals().
Comment #9
jmolivas CreditAttribution: jmolivas at FFW commentedI will give a try to fix the failing tests
Comment #10
lokapujyaAssignment changed while I was uploading this. @jmolivas: You can work on it. I'll upload anyway, because I want to see the test results. This should fix one fail.
Comment #12
joelpittetooo one fail left! Nice
Comment #13
jmolivas CreditAttribution: jmolivas at FFW commentedlokapujya: awesome
joelpittet: I'll take care of the last one
Comment #14
lokapujyaLast Fail, clue: Something is happening in \Drupal::translation()->translate( line 59 of: core/modules/system/src/Tests/Module/UninstallTest.php that is messing up the string that is passed to the assert().
Comment #15
lokapujyaThe modules names are not getting displayed instead of the title. Don't know how to get module title.
Comment #17
lokapujyaComment #18
jmolivas CreditAttribution: jmolivas at FFW commentedRemoving myself as assigned, since I haven't had time
@lokapujya just a recomendation
interdiff-2507243-54.patch
must be renamed tointerdiff-2507243-54.txt
, to avoid the test-bot to try testing itComment #20
joelpittetA couple things still need some help fixing here that I could spot by scanning the patch:
I don't think they need the data key for these.
This looks like it's translated twice? I could be wrong but inside formatPlural it calls doTranslate in the translationManager and SafeMarkup format and so does the t() call.
Comment #21
lokapujyaYes, no need to translate twice just because we added a div wrapper.
Comment #22
jmolivas CreditAttribution: jmolivas at FFW commentedI replace the Static Service Container wrapper
\Drupal::translation()
by injecting thestring_translation
service.Comment #23
joelpittet@jmolivas that is a bit of scope creep on this issue. Would you mind moving that to a follow-up issue please?
Mention the new issue number and that may get in quicker than this issue, hope not but likely ;)
There are a few other things in this patch like the typo/language fix that should also be in in it's own issue to avoid cluttering.
Comment #24
joelpittetComment #25
jmolivas CreditAttribution: jmolivas at FFW commented@joelpittet I replace it on new code that was aded on this patch, I was trying to avoid adding legacy code when adding new lines.
My interdiff file was bad I uploaded again please confirm is still is needed to remove code ?
Comment #26
joelpittet@jmolivas Yeah it's creeping the scope. The task is to convert one theme_* to a #type=>table. To avoid any overlap with other issues, to make this easier to review and commit we try to avoid adding more than is needed. It's hard to get time for reviewers to look at things we want it as straight forward as possible.
Your changes are an improvement that would be great to have but if this issue didn't make it in for whatever reason it would be nice to still have those changes don't you think? That's why I'm suggesting splitting them out.
Comment #27
jmolivas CreditAttribution: jmolivas at FFW commented@joelpittet: I can not create a new issue and there is no code improvement to do in core at this point, since code is not in core yet.
My proposed changes are not necessary until code get committed, because the code I was improving was added in a previous patch in this same issue.
That said, I need this issue to get committed and after that, add a new issue and then update code which I thinks is unnecessary since code is not been committed yet.
Comment #28
star-szrTo be frank that injection change is much lower priority than removing the theme function. If we can reduce the scope the patch is easier to review and maintain as @joelpittet said.
It's also not totally uncommon to open a follow-up and upload a patch that requires another patch to be applied first. But realistically I don't think that injection change is dependent on this conversion, unless there is no translation at all before conversion which I find hard to believe unless there is a bug.
Comment #29
jmolivas CreditAttribution: jmolivas at FFW commentedUploading patch form #21 this does not included injecting dependency.
Comment #30
star-szrThanks @jmolivas, it's a tough balance but in my experience smaller scope = greater chance of completion :)
Setting to needs review.
Comment #31
joelpittetThese are likely better off as an inline template. My brain hasn't really grasped the reasons why, but they are getting accepted with open arms and because they in the render api they can be altered a bit easier.
Comment #32
akalata CreditAttribution: akalata commentedClosing in favor of #2151113: Convert theme_system_modules_uninstall() to Twig.
Comment #33
mr.baileysTalked this through with @akalata, and since the current theme function includes form elements besides the table itself, the approach in this issue might be better than converting the entire theme function to a twig template as attempted in #2151113: Convert theme_system_modules_uninstall() to Twig. Re-opening this one, and closing the other one as duplicate.
Comment #34
akalata CreditAttribution: akalata commented