Error when adding a second parameter in embedding personified block

Created on 13 September 2022, over 2 years ago
Updated 20 May 2024, 9 months ago

Problem/Motivation

Clicking "Add another item" in the Parameters section provides an Ajax error due to a missing array in addMoreCallback.

Steps to reproduce

  1. Installed fresh D9.4.5
  2. Installed: JSON Template 1.0.0, Personified 1.0.0-alpha-3, Smart Content 3.0.0 (And Smart Content Block, Smart Content Browser)
  3. Place a new Decision Block
  4. Create a Segment of True
  5. Add a "Personified Data" block to display
  6. Add an Endpoint URL
  7. Add a Source key, Endpoint Key and Default Value
  8. Click "Add another item"

The error log reads:

Warning: Undefined array key "params" in Drupal\personified\Plugin\Block\PersonifiedData::addMoreCallback() (line 216 of /app/web/modules/contrib/personified/src/Plugin/Block/PersonifiedData.php)

addMoreCallback wants to:

return $form['settings']['params']['wrapper'];

However there is no $form['settings']['params']

🐛 Bug report
Status

Needs work

Version

3.1

Component

Code

Created by

🇦🇺Australia Toby Wild

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I can replicate it with Smart content module of 3.1.0 module

    {
      "message": "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/structure/block/add/smart_content_decision_block/convivial_bootstrap?region=sidebar&_wrapper_format=drupal_ajax&ajax_form=1\nStatusText: parsererror\nResponseText: TypeError: Drupal\\Core\\Render\\MainContent\\AjaxRenderer::renderResponse(): Argument #1 ($main_content) must be of type array, null given, called in /app/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php on line 89 in Drupal\\Core\\Render\\MainContent\\AjaxRenderer->renderResponse() (line 49 of /app/web/core/lib/Drupal/Core/Render/MainContent/AjaxRenderer.php).",
      "name": "AjaxError"
    }

    Moving to smart_content module. Seeking advice on how to fix it

Production build 0.71.5 2024