Problem/Motivation
#2280961: (Views)FieldPluginBase::advancedRender() calls SafeMarkup::set() on a string that it doesn't know to be safe is supposed to fix all SafeMarkup::set()
calls.
One of them is already solved in #2280961-25: (Views)FieldPluginBase::advancedRender() calls SafeMarkup::set() on a string that it doesn't know to be safe, the other ones are harder
but will certainly need a total orthogonal fix.
field/Field.php is using some items imploded with some string.
Proposed resolution
Let's get just that change in and work on the other problem.
This items imploded with some string can be replaced by a twig inline template.
Remaining tasks
User interface changes
API changes
On top of fixing the bug we introduce interfaces for field api handler:
\Drupal\views\Plugin\views\Field\FieldHandlerInterface
: An interface for every views field\Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface
: An interface for field handlers which renders multiple items per row
This is a pure API additional as currently everyone has to extend the FIeldPluginBase
class anyway.
This API change makes it easier for people to write proper multi item field handlers.
Beta phase evaluation
Issue category | Task: Part of the existing SafeMarkup::set meta issue |
---|---|
Issue priority | Inherits a critical from the parent issue |
Disruption | The API addition (interface) will not break any existing code, but just potential open up better ways. |
Comment | File | Size | Author |
---|---|---|---|
#16 | 2397727-16.patch | 27.55 KB | jibran |
#16 | interdiff.txt | 1.42 KB | jibran |
Comments
Comment #1
dawehner.
Comment #2
dawehnerComment #3
jibraninjection
This is not helpful at all.
Gets
"Returns" and @param block missing.
Provides
Replaces and @param block missing.
Gets
Runs
Renders
Performs
Trims
Gets also @param block missing.
Passes
Renders
What?
Comment #4
dawehner@jibran
Thank you for your review, but please take in mind that we mostly move the existing public functions into an interface. Nitpicking them here is not that helpful.
Comment #5
jibranI know we are just moving the code around but we have to fix these doc issues so I'll try to reroll the patch.
Comment #6
dawehnerWell, can you then please fix all other doc issues as well :P
Comment #7
jibranFixed the doc issues and renamed
render_item
torenderItem
. RemovedPrerenderList::allowAdvancedRender
because now it is same asFieldPluginBase::allowAdvancedRender
Comment #8
jibran@dawehner could you please review the doc changes?
Comment #9
dawehner@jibran
Thank you for your hard work, but still I disagree with fixing all the docs here ... It is not the main point of this issue.
Is there a reason why we need to fix all the @inheritdoc entries here? You know, fixing stuff is easy but reviewing all the crap is a different topic. Can't we fix that in a follow up?
Afaik renaming the function is totally unrelated to fix the issue ... it is an api change, no matter how you see it.
Comment #10
jibranI agree with @dawehner will fix both the points. Thanks for the review.
Comment #11
jibranFixed #9
Comment #12
dawehnerThank you!
Well, I'm fine with the patch as it is :)
Comment #13
dawehnerWell, technically it is a subissue of an existing critical one
Comment #14
jibranI think main thing here is done. I only fixed the doc so setting it to RTBC.
Comment #15
alexpottThe issue summary does not really cover why we are introducing the new interfaces. And the introduction of the new interfaces could be added to the API section.
A few minor nits.
Not used
Missing param
gst?
Comment #16
jibran@dawehner can you please update the issue summary?
Comment #17
dawehnerAdapted the IS to include some mentions about the new interfaces.
Comment #18
jibranSo back to RTBC then.
This qualify as an improved DX.
Comment #19
webchickBack to Alex.
Comment #20
alexpottCommitted 041511a and pushed to 8.0.x. Thanks!
This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes.