REST views: fatal error when using row plugin and Views is aware of non-Entity-based tables

Created on 8 March 2017, over 7 years ago
Updated 27 February 2023, over 1 year ago

I'm not able to create a view with a working "REST export" display.

Steps

1. Create view with indexed source (Search API)
2. Add REST ("REST export") display to created view
3. Define path for "REST export", e.g. "/rest_bug.json"
4. Save view
5. Open path "/rest_bug.json"
6. Result: Error 500 with message "The website encountered an unexpected error. Please try again later."

Trace

AH01071: Got error 'PHP message: Error: Call to a member function id() on boolean in …/core/modules/rest/src/Plugin/views/row/DataEntityRow.php on line 86

#0 …/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php(52): Drupal\\rest\\Plugin\\views\\row\\DataEntityRow->getEntityTypeId()\n
#1 …/core/modules/rest/src/Plugin/views/row/DataEntityRow.php(115): Drupal\\rest\\Plugin\\views\\row\\DataEntityRow->getEntityTranslationRenderer()\n
#2 …/core/modules/views/src/Plugin/views/style/StylePluginBase.php(833): Drupal\\rest\\Plugin\\views\\row\\DataEntityRow->query()
#3 …/core/modules/views/src/ViewExecutable.php(1291): Drupal\\views\\Plugin\\views\\style\\StylePluginBase->query(false)
#4 …/core/modules/views/src/Plugin/views/display/PathPluginBase.php(351): Drupal\\views\\ViewExecutable->build()

Setup

Ubuntu 16.04 LTS, PHP 7.0, MySQL 5.6, Drupal 8.2

🐛 Bug report
Status

Closed: duplicate

Version

10.1

Component
REST 

Last updated 4 days ago

Created by

🇩🇪Germany Kartoffelsalat

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024