Dear Views Entity View Friends:
I am now consistently getting the following warning message after building a "views field view" that contains a field from a contextual view. The error shows up after I flush the cache and goes away when I refresh the browser:
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 227 of core\lib\Drupal\Core\Entity\EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 57)
Drupal\node\Plugin\views\argument\Nid->titleQuery() (Line: 82)
Drupal\views\Plugin\views\argument\NumericArgument->title() (Line: 976)
Drupal\views\Plugin\views\argument\ArgumentPluginBase->getTitle() (Line: 1099)
Drupal\views\ViewExecutable->_buildArguments() (Line: 1254)
Drupal\views\ViewExecutable->build(NULL) (Line: 1378)
Drupal\views\ViewExecutable->execute() (Line: 263)
Drupal\views_field_view\Plugin\views\field\View->render(Object) (Line: 1144)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 224)
template_preprocess_views_view_field(Array, 'views_view_field', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render(Array, Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 1736)
Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 765)
Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 713)
Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 580)
Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 467)
Drupal\views\Plugin\views\style\StylePluginBase->render(Array) (Line: 2117)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1520)
Drupal\views\ViewExecutable->render() (Line: 171)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1617)
Drupal\views\ViewExecutable->executeDisplay('purchase_contracts', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Issue fork views_field_view-2844248
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 8.x-1.x changes, plain diff MR !3
- 2844248-warning-arrayflip-can changes, plain diff MR !2
Comments
Comment #2
Znak CreditAttribution: Znak commentedI couldn't reproduce your error. Write where you building a "views field view"
Comment #3
jibranCan you please share the sample parent and child view?
Comment #4
crasx CreditAttribution: crasx at Bounteous commentedThis happened to me because my view was using
{{ fields.nid }}
instead of{{ raw_fields.nid }}
. This caused a markup object to be passed as an argument to the child view instead of a stringComment #5
jessicakoh CreditAttribution: jessicakoh commentedto reproduce this error:
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 175 of /Users/abc/sites/includes/entity.inc).
1. Update Media and File_Entity
2. Go to appearance, upload a custom logo.
Comment #6
steveoriolThank you crasx (#4), Your tip my help ;-)
Comment #7
aaronglamb CreditAttribution: aaronglamb commentedI second the thanks to #4 FTW. Cheers.
Comment #8
nghai CreditAttribution: nghai at ]init[ AG commentedConfirmed, #4 fixed the issue.
Comment #9
RomixuaThank You @crasx (#4), your decision fixed this issue.
Comment #10
trangunghoa CreditAttribution: trangunghoa commentedThank You @crasx (#4), you saved my time.
Comment #11
PanchoComment #12
matt_zimo CreditAttribution: matt_zimo commentedThank you @crasx!
Comment #13
usmanjutt84#4 works for me.
Comment #14
jwineichen CreditAttribution: jwineichen commentedJust to clarify, does this mean this is a documentation issue and we should always just use the raw nid or is this a bug that needs to be fixed?
Comment #15
revati_gawasThanks @crasx! It helps to fixed my issue.
Comment #16
boby_ui CreditAttribution: boby_ui as a volunteer commentedthis is strange, once I used raws, the site broke into error :
like placeholder without trailing
Comment #17
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commented#4 fixed my issue. Thankyou @crasx.
Comment #18
SAVEL CreditAttribution: SAVEL as a volunteer and at EPAM Systems commented#4 must fix the issue, but I'm getting an error for the multivalued argument and the view is broken.
Comment #19
SAVEL CreditAttribution: SAVEL as a volunteer and at EPAM Systems commentedDon't we have enough information to proceed?
By the way error from #18 is related to https://www.drupal.org/project/views_field_view/issues/2873359
It offers a patch but solves the problem not in an elegant way (regexp).
Comment #23
SAVEL CreditAttribution: SAVEL as a volunteer and at EPAM Systems commentedAdding an explicit conversion to string solves the problem.
Please review.
Comment #24
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commented@SAVEL - your patch (mr!3) fixed the issue for me, as well as a related issue, which output:
Warning: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->load() (line 297 of /code/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
Comment #26
dawehnerThank you @savel for the patch and @andileco for the testing.