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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

snsblvd created an issue. See original summary.

frjo’s picture

Assigned: Unassigned » frjo
Status: Active » Needs review
FileSize
5.06 KB

Thanks 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.

frjo’s picture

Status: Needs review » Fixed

  • frjo committed bbd0171 on 8.x-1.x
    Issue #2649886 by frjo, snsblvd: Content image style for first image is...

Status: Fixed » Needs work

The last submitted patch, 2: colorbox_first_image_style_2649886.patch, failed testing.

frjo’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.