Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
views.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jan 2017 at 14:57 UTC
Updated:
12 May 2017 at 13:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jibranNow you can do this in alter hook.
Comment #3
dawehnerI am wondering why we don't just put that information into the render array and extract if from there.
Comment #4
jibran\Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase::renderExposedForm()adds it to$form_statebut only returns$form.\Drupal\views\Form\ViewsExposedForm::buildForm()can add it to the$formarray but it has$form_stateavailable.Where do you suggest we should add it?
\Drupal\views\Plugin\Block\ViewsBlock::build()provides this info in render array keys under'#view'and'#display_id'.Maybe
\Drupal\views\Plugin\Block\ViewsExposedFilterBlock::build()can provide those keys?Comment #5
jibranHow about something like this?
Comment #6
dawehnerThis looks way better for me! Let's add a line to document what is going on.
Comment #7
jibranHere we go.
Comment #8
dawehnerThis looks reasonable for me ... I wonder whether its possible to test this somehow.
Comment #9
jibranI don't think it is worth testing. It is just some context metadata. Unless we want to test it for all the views render output arrays?
Comment #11
jibranComment #12
dawehnerComment #13
sail3 commentedi am working on this issue with @PaulDeza
Comment #14
sail3 commentedWe(me and @PaulDeza) have tested the patch and it is working as espected.
Comment #15
xjmComment #17
xjmI could not find a user account for @PaulDeza to add to the potential credit list; can we add a link to their profile?
@sail3, to receive issue credit for your contribution, can you describe specifically how you tested the patch, and what the results were? Thanks!
This in-line comment doesn't actually help all that much. Can we expand it a little to describe how the context is used? Also, the fact that it is a render array is clear from the code, so I don't think we need to add those last three words. The fact that it is context metadata is what's important.
Won't these added keys need to be documented in some docblock somewhere? (Maybe that documentation doesn't exist elsewhere yet, because it's Views.)
Thanks, all!
Comment #18
jibranThanks! @xjm for the feedback. Fixed everything in #17.
You should start using PHPStrom instead of emacs :D :P
Comment #19
lendudeAll feedback from @xjm has been addressed, updated the IS to reflect the actual fix.
Comment #20
alexpottComment #21
alexpottCommitted 0db6843 and pushed to 8.4.x. Thanks!
Since this is a task only committed to 8.4.x