Problem/Motivation
This issue blocks #2173655: Refactor theme() to _theme(); make it a private API to discourage module developers from circumventing the renderable build system. See #2006152: [meta] Don't call theme() directly anywhere outside drupal_render() for instructions.
There are three remaining calls to theme() in Views plugins:
./core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: return theme($this->themeFunctions(),
./core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php: return theme($this->themeFunctions(),
./core/modules/views/lib/Drupal/views/Plugin/views/style/Rss.php: $output = theme($this->themeFunctions(),Proposed resolution
Review these and see if they can be refactored to not call theme() directly.
Remaining tasks
Git blame these lines to see how and when theme() was reintroduced, then create a patch to convert them. See #2007052: Replace theme() with drupal_render() in views.module for previous conversions in Views.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2191101-9.patch | 3.1 KB | star-szr |
| #9 | interdiff.txt | 615 bytes | star-szr |
| #7 | 2191101-7.patch | 3.09 KB | thedavidmeister |
Comments
Comment #1
xjmComment #2
star-szrThanks @xjm!
Comment #3
thedavidmeister commentedHaving a look...
Comment #4
thedavidmeister commentedFieldPluginBase:
Comment #5
thedavidmeister commentedRssFields:
Comment #6
thedavidmeister commentedRss.php:
Comment #7
thedavidmeister commentedtry this.
Comment #8
star-szrThanks!
Comment #9
star-szrCode looks good and I manually tested all three occurrences, there was no difference in the output. I'm just adding a missing trailing comma here per http://drupal.org/coding-standards#array.
Please cooperate, testbot! :)
Comment #10
star-szrCrosslinking with #2111079: Add @code sample and test coverage per hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter() for @thedavidmeister's core review bonus thingy :)
Comment #11
alexpottCommitted 0b66890 and pushed to 8.x. Thanks!