On saving a link field with a default URL and class I'm getting a WSOD. Looking at the recent log messages gives me the following error:

InvalidArgumentException: The configuration property default_value.0.options.attributes.class.0 doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of /var/www/vhosts/example.com/docroot/core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

CommentFileSizeAuthor
#7 Screenshot 2020-11-22 at 15.37.54.png189.24 KBgauravvvv

Comments

vaccinemedia created an issue. See original summary.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Chance you could provide a full stack trace?

larowlan’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: +Needs tests

@Berdir confirmed this is a schema issue but we can't simply say 'all the items are strings except this one, which is an array' so we might need to store default settings as a string, even though the data is an array

larowlan’s picture

martijn de wit’s picture

First I had to figure out that a default value on a link always need a url... Because there is no validation error... (https://www.drupal.org/project/drupal/issues/2708101)

After entering a valid url, now getting the same error.

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: The configuration property default_value.0.options.attributes.class.0 doesn&#039;t exist. in <em class="placeholder">Drupal\Core\Config\Schema\ArrayElement-&gt;get()</em> (line <em class="placeholder">76</em> of <em class="placeholder">core/lib/Drupal/Core/Config/Schema/ArrayElement.php</em>). <pre class="backtrace">Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value.0.options.attributes.class.0&#039;, &#039;btn&#039;) (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value.0.options.attributes.class&#039;, Array) (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value.0.options.attributes&#039;, Array) (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value.0.options&#039;, Array) (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value.0&#039;, Array) (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue(&#039;default_value&#039;, Array) (Line: 212)
Drupal\Core\Config\Config-&gt;save() (Line: 284)
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;doSave(&#039;paragraph.slide.field_call_to_action&#039;, Object) (Line: 429)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object) (Line: 263)
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;save(Object) (Line: 390)
Drupal\Core\Entity\Entity-&gt;save() (Line: 635)
Drupal\Core\Config\Entity\ConfigEntityBase-&gt;save() (Line: 178)
Drupal\field_ui\Form\FieldConfigEditForm-&gt;save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;field_config_edit_form&#039;, Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;field_config_edit_form&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>
sahil432’s picture

Facing same issue, Any update on this

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new189.24 KB

1. Run composer install command in Root folder.
2. Add " module weight : 0 " line in core.extension.yml file for example: " stage_file_proxy: 0"
3. Clear the cache
4. Import your config.
This works for me. Please review

roshnykunjappan’s picture

I'm getting the same error. Any update on this?

cpierce42’s picture

I am also having this issue but while attempting to reference a custom module's single block plugin from a paragraph only if that block(plugin) has 'checkboxes' options (radios, single Boolean checkbox, etc).

anybody’s picture

Might this be resolved with #3167079: Remove the special handling of 'class' attribute in favour of classed plugins?
I think we should have a test-only test to check this as first step? That would make this more clear.

anybody’s picture

Status: Needs review » Needs work

Needs tests to reproduce this please and ensure it's fixed, once #3167079: Remove the special handling of 'class' attribute in favour of classed plugins is resolved.

larowlan’s picture

Version: 8.x-1.5 » 2.x-dev
xiaoo’s picture

Same error when trying to set default value in link field inside Paragraph