Recently I updated my drupal site from 8.6.14 to 8.7.6.

A previously-working Entity Reference View display that is connected to a form Autocomplete field stopped working.
The spinning circle keeps spinning and does not match user input to an entity.
(The ER View display concatenates a user email address and his company name for easier user selection : ie "joe@smith.com - Smith Plumbing, Inc." )

Error in log is:

Error: Class 'Drupal\views\Plugin\EntityReferenceSelection\Xss' not found in Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection->stripAdminAndAnchorTagsFromResults() (line 272 of /Applications/MAMP/htdocs/chapter6/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php)

I added use Drupal\Components\Utility\XSS to ViewSelection.php and now the error is

Recoverable fatal error: Object of class Drupal\views\ViewExecutable could not be converted to string in Drupal\Core\Entity\EntityAutocompleteMatcher->getMatches() (line 69 of /Applications/MAMP/htdocs/chapter6/core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php)

Has anyone else experienced this in latest drupal 8?

  • 2
    You've installed a patch from this issue drupal.org/project/drupal/issues/2174633, which obviously no longer applies. – 4k4 Aug 22 '19 at 21:21
  • Thank you, yes. I had applied patch drupal/issues/2174633#238 last February. Had to remove that and apply drupal/issues/2174633#323 to drupal 8.7.6 to get it working. All is well. – MEI Aug 23 '19 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.