Part of #1876712: [meta] Convert all tables in core to new #type 'table'
Convert the Languages admin screen 'admin/config/regional/language' to use new #type 'table' and its tabledrag support, and remove specific theme function theme_language_admin_overview_form_table()
Comment | File | Size | Author |
---|---|---|---|
#10 | language_table-1877338-10.patch | 2.68 KB | plopesc |
#8 | language_table-1877338-8.patch | 2.65 KB | plopesc |
#5 | language_table-1877338-4.patch | 2.87 KB | plopesc |
#5 | interdiff.txt | 528 bytes | plopesc |
#2 | language_table-1877338-2.patch | 2.72 KB | plopesc |
Comments
Comment #1
kim.pepperTagging
Comment #2
plopescAttaching patch that rewrites the table creation process according to new #type 'table' element.
Comment #3
plopescUpdating status
Comment #5
plopescSorry, I removed three necessary lines for the locale module integration.
Re-rolling patch.
Comment #6
plopescChanging status
Comment #8
plopescPatch fixed.
Comment #9
sunThanks! I think this is correct and almost complete.
Thanks for splitting a first conversion out from #1876712: [meta] Convert all tables in core to new #type 'table' to review and discuss it in more detail.
However, I think we want to perform almost all of the remaining conversions in one fell swoop in #1876712: [meta] Convert all tables in core to new #type 'table', since the resulting patch will only be large, but not really complex. AFAIK, there are only a few instances of more complex tables left in core, which I think involve #tableselect (not #tabledrag). In any case, I think we can do all of the simple conversions in one go after this one.
The only two issues I can see with this patch:
1) #tree can definitely be removed. #type 'table' sets that by default already.
2) #languages and #language_default seem to be obsolete, too?
Comment #10
plopescHello
Thanks for your review. I removed hte #tree attribute, following your advice. However, #languages and #language_default attributes can't be removed, because are required by locale module to add the operations column to the table.
Removing these two attributes, tests are not passed, as you can see in #1.
Regards.
Comment #11
sunOh, I see.
We might want to create a separate issue for those language properties then. For one, it's a bit strange that they are added to the top-level table element, instead of the corresponding table row. And second, we actually try to avoid adding raw data objects in the $form structure; contextual data objects are added and tracked in $form_state normally; i.e., $form['languages']['#languages'] becomes $form_state['languages'] and $form['languages']['#language_default'] becomes $form_state['language_default'].
Not to be changed in here, but I think that would make a nice clean-up issue — anyone willing to take that on? :)
This patch is ready to go, thanks! :)
Comment #12
kim.pepperCreated follow up issue #1882712: Language admin form: move top-level language properties to table form row
Comment #13
plopescSorry, I created this follow up issue #1882448: Decouple language and locale modules in language_admin_overview_form() , but I forgot to add the comment here.
Includes patch that passes the tests.
Regards
Comment #14
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.
Comment #15
Gábor HojtsyRetroactively tagging for D8MI :)