ViewsStyle plugin causes TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in in_array() (line 196 of /app/web/core/themes/claro/src/ClaroPreRender.php)

Created on 1 February 2024, 5 months ago
Updated 2 February 2024, 5 months ago

Problem/Motivation

When opening the Views plugin Settings in Drupal 10.2.2 and Geofield Map 3.0.14 with Claro (or Gin which depends on it) enabled, the following error prevents the settings from opening at all:

TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in in_array() (line 196 of /app/web/core/themes/claro/src/ClaroPreRender.php).

With an extract from backtrace:

#0 /app/web/core/themes/claro/src/ClaroPreRender.php(196): in_array('sticky-enabled', 'map-theming-opt...')
#1 [internal function]: Drupal\claro\ClaroPreRender::tablePositionSticky(Array)
#2 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array(Array, Array)
#3 /app/web/core/lib/Drupal/Core/Render/Renderer.php(858): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#4 /app/web/core/lib/Drupal/Core/Render/Renderer.php(421): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#5 /app/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)

Steps to reproduce

Open Settings on the Geofield Map settings plugin on a View with a Geofield, on a site using Drupal 10.2.2, Geofield Map 3.0.14 and Claro administration theme.

Proposed resolution

It appears Claro expects an array when passing in class attribute map-theming-options at line 737 of src/Plugin/views/style/GeofieldGoogleMapViewStyle.php, so will need to pass in the class as an array of strings

πŸ› Bug report
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom sergiur London, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sergiur
  • Issue was unassigned.
  • Status changed to Closed: outdated 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom sergiur London, UK

    This appears to be fixed in dev. Using that for now, pending a release

Production build 0.69.0 2024