Problem/Motivation

We use Paragraph Sets to get a default set of three "Slides" on a "Slideshow" component. Before updating from 3.0.1, it worked as expected.

After updating to 3.0.2, clicking the "Add Slideshow" paragraph button on the node edit screen gives an AJAX error.

After updating, my default slides were not appearing. I navigated to the Form Display settings for the parent component, and changed the field widget so that "Show Paragraphs Sets" was enabled. I saved, then went back to the edit form. I now get the AJAX error if I try to add the component again.

The website encountered an unexpected error. Try again later.<br><br><em class="placeholder">Error</em>: Call to a member function getFieldDefinition() on null in <em class="placeholder">Drupal\paragraphs_sets\ParagraphsSets::buildSelectSetSelection()</em> (line <em class="placeholder">114</em> of <em class="placeholder">modules/contrib/paragraphs_sets/src/ParagraphsSets.php</em>). <pre class="backtrace">paragraphs_sets_field_widget_complete_form_alter() (Line: 552)
Drupal\Core\Extension\ModuleHandler-&gt;alter() (Line: 156)
Drupal\Core\Field\WidgetBase-&gt;form() (Line: 1512)
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget-&gt;form() (Line: 190)
Drupal\Core\Entity\Entity\EntityFormDisplay-&gt;buildForm() (Line: 843)
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget-&gt;formElement() (Line: 459)
Drupal\Core\Field\WidgetBase-&gt;formSingleElement() (Line: 1390)
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget-&gt;formMultipleElements() (Line: 120)
Drupal\Core\Field\WidgetBase-&gt;form() (Line: 1512)
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget-&gt;form() (Line: 190)
Drupal\Core\Entity\Entity\EntityFormDisplay-&gt;buildForm() (Line: 121)
Drupal\Core\Entity\ContentEntityForm-&gt;form() (Line: 134)
Drupal\node\NodeForm-&gt;form() (Line: 107)
Drupal\Core\Entity\EntityForm-&gt;buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder-&gt;retrieveForm() (Line: 375)
Drupal\Core\Form\FormBuilder-&gt;rebuildForm() (Line: 633)
Drupal\Core\Form\FormBuilder-&gt;processForm() (Line: 326)
Drupal\Core\Form\FormBuilder-&gt;buildForm() (Line: 73)
Drupal\Core\Controller\FormController-&gt;getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController-&gt;getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle() (Line: 53)
Drupal\Core\StackMiddleware\Session-&gt;handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength-&gt;handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle() (Line: 53)
Asm89\Stack\Cors-&gt;handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle() (Line: 741)
Drupal\Core\DrupalKernel-&gt;handle() (Line: 19)

Steps to reproduce

1. Update module to 3.0.2.
2. Modify Form Display settings for parent component (in my case, it was a Paragraph of Slideshow that had a field called "Slides" which was an Entity reference revisions field using the "Paragraphs" widget.)
3. Edit widget of field and enable "Enable Paragraphs Sets".
4. Save.
5. Navigate to content type and attempt to add a "Slideshow" paragraph.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nessthehero created an issue. See original summary.

nessthehero’s picture

Status: Active » Closed (cannot reproduce)

nm, unable to reproduce

stborchert’s picture

Version: 3.0.2 » 3.0.x-dev
Assigned: Unassigned » stborchert
Status: Closed (cannot reproduce) » Active

We ran into this error also, so it's time to fix it :/

stborchert’s picture

Assigned: stborchert » Unassigned
Status: Active » Needs review

Oh, wow.
While fixing issues raised by PHPStan I managed to break some function references 🙈 Fixed that.

  • 91f466bd committed on 3.0.x
    Issue #3527072 by nessthehero, stborchert: AJAX error when adding...
stborchert’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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