When a formatter has no settings, but a contrib module adds third party settings, the UI brakes and you can find a warning in the logs.

Warning: array_intersect_key(): Argument #1 is not an array in Drupal\Core\Field\FormatterPluginManager->prepareConfiguration() (line 164...)

Major, as it breaks a lot of the UI when you're installing a contrib module like Display Suite.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug, because it throws a warning
Issue priority Normal, because the impact is just really scoped for admins
Disruption No discruption
CommentFileSizeAuthor
#6 2536906-6.patch2.11 KBaspilicious
#1 2536906-test-only.patch1009 bytesaspilicious

Comments

aspilicious’s picture

Status: Active » Needs review
StatusFileSize
new1009 bytes

Here is the test

dawehner’s picture

Nice, let's see whether it fails ...

aspilicious’s picture

Funny thing is that it has a mechanism with missing $configuration params

  public function prepareConfiguration($field_type, array $configuration) {
    // Fill in defaults for missing properties.
    $configuration += array(
      'label' => 'above',
      'settings' => array(),
      'third_party_settings' => array(),
    );

But the $configuration array passed already has 'settings' set to FALSE/NULL. We can fix it in prepare configuration but I think we need to deal with it at the source. But I can't find my way in the class chain.

Status: Needs review » Needs work

The last submitted patch, 1: 2536906-test-only.patch, failed testing.

aspilicious’s picture

Assigned: Unassigned » aspilicious

Ok test result makes more sense, fixing it

aspilicious’s picture

Status: Needs work » Needs review
StatusFileSize
new2.11 KB
dawehner’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community

I think @aspilicious needs more challenging tasks :)

Added a beta evaluation, which let me treat this as normal issue, feel free to disagree. There has been way worse normal issues out there.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Nice find. Committed f70bf71 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed f70bf71 on 8.0.x
    Issue #2536906 by aspilicious: Warning when saving third party settings...

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 6: 2536906-6.patch, failed testing.

  • alexpott committed f70bf71 on 8.1.x
    Issue #2536906 by aspilicious: Warning when saving third party settings...
swentel’s picture

Status: Needs work » Closed (fixed)