While using the example module, I found that the dropdown plugin can no longer change the widget.
The ajax error received in response is:

{"message":"A fatal error occurred: Settings can not be serialized. This probably means you are serializing
 an object that has an indirect reference to the Settings object. Adjust your code so that is not necessary."}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JayeshSolanki’s picture

Issue summary: View changes
samuel.mortenson’s picture

I get this for any browser using a modal display.

samuel.mortenson’s picture

samuel.mortenson’s picture

Added possibly related core regression.

samuel.mortenson’s picture

Priority: Normal » Major

Moving to Major as this seems to affect multiple features of the module and the related issue's patch doesn't fix this problem.

slashrsm’s picture

Issue tags: +Media Initiative, +sprint
slashrsm’s picture

Issue tags: -sprint +D8Media
samuel.mortenson’s picture

After applying the patch from the related issue, I'm now getting

{"message":"A fatal error occurred: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution."}

Guessing that the Connection object is being added to the form somewhere.

samuel.mortenson’s picture

It looks like the views display plugin "entity_browser" was adding the View to the render array before the form was cached, which caused the series of errors described in this issue. This patch moves the view to the elementPreRender method, which does not cache/serialize the View. No other patch is required, but I'll keep the related issue around for posterity.

samuel.mortenson’s picture

Status: Active » Needs review
samuel.mortenson’s picture

Status: Needs review » Needs work

Making some changes and re-pulling...

slashrsm’s picture

samuel.mortenson’s picture

Status: Needs work » Closed (fixed)

Sorry @slashrsm, I didn't do my due-diligence and follow up on this issue. The dropdown seems to be working fine, so I'm closing this out. Thanks!