This is reliant on #1993312: Change pre_render, post_render, and after_build callbacks to accept callables, but once in we can attach and render callbacks to plugins/handlers. This seems generally a nice idea to me. This function is only applicable to the Drupal\views\Plugin\views\field\Custom handler, but currently lives in views.module. Just doesn't make sense. Patch attached containing #1993312 also, if people want to test.
Steps to test:
- Add a 'Global: Custom text' field handler
- On the handler edit form 'Text' textarea should appear directly below the 'exclude from display' checkbox (screenshot attached)
Comment | File | Size | Author |
---|---|---|---|
#8 | 1993330-8.patch | 1.9 KB | damiankloip |
#5 | 1993330-5.patch | 1.9 KB | damiankloip |
#3 | 1993330-3.patch | 1.83 KB | damiankloip |
vdc.move-custom_pre_render-do-not-test.patch | 1.77 KB | damiankloip | |
vdc.move-custom_pre_render-with-1993312.patch | 3.68 KB | damiankloip | |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commented.
Comment #2
dawehnerShould we document the parameter?
Comment #3
damiankloip CreditAttribution: damiankloip commented#1993312: Change pre_render, post_render, and after_build callbacks to accept callables got in, so this is all go.
Comment #4
dawehnerNeeds also an @return :(
Comment #5
damiankloip CreditAttribution: damiankloip commentedBah!
Comment #6
dawehnerThank you
Comment #7
alexpottNeeds a reroll...
Comment #8
damiankloip CreditAttribution: damiankloip commentedRerolled
Comment #9
dawehnerRertbced
Comment #10
alexpottCommitted 71eba4f and pushed to 8.x. Thanks!
Comment #12
xjmComment #13
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedFor more information as to why this issue was moved to the Drupal core project, please see issue #3030347: Plan to clean process issue queue
Comment #14
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedMoving back to the contributed Views issue queue and closing as outdated per https://www.drupal.org/project/views/issues/3030347#comment-13023447