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
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 2858814-nr-bot.txt | 1.24 KB | needs-review-queue-bot |
| #13 | 2858814-13.patch | 948 bytes | wim leers |
Comments
Comment #2
Kartoffelsalat commentedI have found a workaround (or the solution?):
Comment #3
wim leersComment #4
wim leersComment #5
badrange commentedThank you for this workaround Kartoffelsalat - and thank you Google for giving as one of the top search results when searching for the error message :)
Comment #6
wim leersFrom the Steps To Reproduce (STR):
Moving to their issue queue.
Comment #7
wim leersI wonder if this is actually related to #2666226: REST views: DataEntityRow allows itself to be added to non-entity views.
Comment #8
drunken monkeyThis does look like an issue in the REST module, yes. It might be the same as #2666226: REST views: DataEntityRow allows itself to be added to non-entity views, or just in the same direction – i.e., assuming all views use the default query plugin and display entities (of a single type).
Comment #9
dawehnerI see the problem, this row plugins should not be available for searchapi tables.
Comment #10
abarrioHi! @dawehner when you upload a patch you have to put issue with status needs review. Doing this jenkins will queue your patch to test and validate it.
Comment #11
abarrioComment #13
wim leersAttempting to improve issue title.
Comment #14
wim leersActually, isn't this duplicating #2666226: REST views: DataEntityRow allows itself to be added to non-entity views?
Comment #15
wim leersD'oh, I've already said that in #7 apparently.
@dawehner?
Comment #20
司南 commentedHow to fix this? is there anyone fixed it?
Comment #28
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #29
larowlan#2666226: REST views: DataEntityRow allows itself to be added to non-entity views
Comment #30
larowlan