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

graker created an issue. See original summary.

  • el1_1el committed e1362ce on 8.x-1.x authored by graker
    Issue #3086280 by graker: No HTML filtering in labels
    
el1_1el’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Active » Fixed

Not sure why I did it that way. Commit was 4 years ago. Change made in dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.