Support from Acquia helps fund testing for Drupal Acquia logo

Comments

InternetDevels’s picture

Status: Active » Needs review
FileSize
2.72 KB

Patch added.

Status: Needs review » Needs work

The last submitted patch, 1: replace-theme-with-drupal-render-2177653.patch, failed testing.

InternetDevels’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: replace-theme-with-drupal-render-2177653.patch, failed testing.

jessebeach’s picture

I have just a few tweaks for this one. I ran into trouble with the form label changes. Labels were not rendering:

The form item label changes can be verified on an article add/edit page. Look for labels on the fields and the required marker on the title field.

For the tableselect theme function, we have the opportunity to replace drupal_add_library with #attached, which gets us further along resolving #2171071: Rename drupal_add_library() to _drupal_add_library() and remove its uses.

The tableselect theme changes can be verified by enabling the form_test module and navigating to this path: form_test/tableselect/multiple-true.

jessebeach’s picture

Status: Needs work » Needs review

go bot, go.

Status: Needs review » Needs work

The last submitted patch, 5: replace-theme-drupal-render-form-inc-2177653-5.patch, failed testing.

jessebeach’s picture

Status: Needs work » Needs review
FileSize
3 KB
949 bytes

Test error because empty('0') was evaluating to false. Switched to isset() instead.

jibran’s picture

Patch seems fine to me RTBC for me but let's see what twig guys think about it.

moshe weitzman’s picture

The goal is not to simply replace remove calls to theme() with drupal_render(). It is a code smell to call drupal_render() in regular code. That should just be called by "the framework". When we are within a theme() call, we should not need to do internal (i.e. nested) themeing.

In this patch, can we just kill theme('form_element_label') or integrate it into another theme() hook?

As for theme_tableselect, isn't that deprecated now in favor of a #type = 'table' and #tableselect = TRUE. See https://drupal.org/node/1876710. Might be worth deleting it and seeing what breaks. If something breaks, it can be fixed as part of #1876712: [meta] Convert all tables in core to new #type 'table'

joelpittet’s picture

This patch does very similar things #2152213: Convert theme_form_element() to Twig and the twig conversion. Will cause a re-roll for which gets in first.

And here's another plan for table select:
#2152227: Convert theme_tableselect() to #theme table__tableselect (see not implemented)

jessebeach’s picture

Great joelpittet! I'd rather see #2152213: Convert theme_form_element() to Twig get committed first. It's the best solution here. I reviewed your patch and it looks good - RTBC. Once it gets in we're then only left with the table issue here.

catch’s picture

Status: Needs review » Needs work

Committed that one.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
1.3 KB

Status: Needs review » Needs work

The last submitted patch, 14: 2177653-form-drupal-render-14.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
martin107’s picture

Status: Needs review » Reviewed & tested by the community

clean implementation +1

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.