Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I modify (manage display) the "Content image style for first image" and would like to save the settings, then I see the following warning/error "array_flip" and my settings are not saved. The other settings are working without any problem.
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 232 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
Drupal\Core\Entity\EntityStorageBase->load(1)
Drupal\colorbox\Plugin\Field\FieldFormatter\ColorboxFormatter->viewElements(Object, 'en')
Drupal\Core\Field\FormatterBase->view(Object, NULL)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full')
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full')
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func(Array, Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array, )
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\ban\BanMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
Using: Drupal 8.0.2, PHP 5.6, NGINX
Installed colorbox with:
drush en colorbox
drush colorbox-plugin
Comment | File | Size | Author |
---|---|---|---|
#2 | colorbox_first_image_style_2649886.patch | 5.06 KB | frjo |
|
Comments
Comment #2
frjo CreditAttribution: frjo commentedThanks for the bug report, this feature was really broken. Sorry about that.
The colorbox_node_style_first setting had the wrong type (boolean and not string) and that’s why it was not saved as it should. On top of that the both the formatters viewElements() and the templates preprocess function lacked proper code to handle this setting.
I believe this patch takes care of it.
Comment #3
frjo CreditAttribution: frjo commentedComment #6
frjo CreditAttribution: frjo commented