az-digital / az_quickstart

UArizona's web content management system built with Drupal 10.
https://quickstart.arizona.edu
GNU General Public License v2.0
30 stars 20 forks source link

Inline SVG checkbox for az_barrio theme logo sometimes bricks site. #1758

Open trackleft opened 2 years ago

trackleft commented 2 years ago

Problem/Motivation

While troubleshooting a website that was unuseable on the front-end WSOD

Saw this error

TypeError: Argument 1 passed to Drupal\Core\Render\PlaceholderGenerator::canCreatePlaceholder() must be of the type array, string given, called in /code/web/core/lib/Drupal/Core/Render/Renderer.php on line 326 in Drupal\Core\Render\PlaceholderGenerator->canCreatePlaceholder() (line 35 of /code/web/core/lib/Drupal/Core/Render/PlaceholderGenerator.php) #0 /code/web/core/lib/Drupal/Core/Render/Renderer.php(326):  Drupal\Core\Render\PlaceholderGenerator->canCreatePlaceholder(' 

Narrowed the error down to the az_barrio theme setting for inlining SVGs

Inline logo SVG (Experimental) If logo is SVG image then inline it content in the page instead of using image tag to render it. This is useful when you need to control SVG logo with theme CSS.

If I uncheck the box it goes away.

Describe the bug

Improper render array passed to the renderer.

To Reproduce

Steps to reproduce the behavior:

  1. Visit theme settings for AZ Barrio.
  2. Expand Logo Image accordion.
  3. Clear "Path to custom logo"
  4. Add in your own svg logo
  5. Check the Inline logo SVG (Experimental) checkbox
  6. Save

Proposed resolution

Fix the render array. Possibly something similar this patch https://www.drupal.org/files/issues/2021-12-18/3254973-4.patch

joeparsons commented 11 months ago

We encountered issues with the inline SVG functionality again while testing #2968

TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given in array_intersect_key() (line 348 of core/lib/Drupal/Core/Render/Renderer.php)