Hello!
In OptionsButtons widget (EntityReferenceViewsOptionsButtonsWidget.php) there's a line:
$filter_options[$row->_entity->id()] = $options[$row->_entity->id()]->create($this->renderer->render($row_output));
It is responsible for creating checkbox / radio button labels. And what create() method does here is that it filters out HTML tags from provided string (rendered Views row).
I wonder if it is really needed for this module. I mean, if the idea is to use Views output for labels, isn't it better to output Views HTML as it is? And let Views do all the escaping and filtering if it is needed?
I'm running my code with this create() call removed, no problem so far:
$filter_options[$row->_entity->id()] = $this->renderer->render($row_output);
P.S. I get the part about module is going to be in the core soon, just wondering.
Comments
Comment #3
el1_1el commentedNot sure why I did it that way. Commit was 4 years ago. Change made in dev branch.