Problem/Motivation

When using Display Builder with ui_styles module activated but without ui_styles_ui_patterns, i have a "plugin not found" fatal error.

This may be because of this method introduced by #3616791: Implement visual settings summary

  public function getSummary(): array {
    /** @var \Drupal\ui_patterns\SourceInterface $source */
    $source = $this->sourceManager->createInstance('ui_styles_attributes', [
      'settings' => ['styles' => $this->data],
    ]);

    return $source->settingsSummary();
  }

Proposed resolution

2 proposals:

  • Replace ui_styles by ui_styles_ui_patterns in island attributes
  • Wrap getSummary logic into a moduleHandler->moduleExists('ui_styles_ui_patterns()
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

pdureau created an issue. See original summary.

pdureau’s picture

Title: Style panel must have ui_styles_ui_patterns as dependences » Style panel: missing ui_styles_ui_patterns plugin
Issue summary: View changes

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Active » Needs review
Issue tags: -display_builder-beta +display_builder-1.0.0-beta

Pipeline running.

I did moduleHandler->moduleExists('ui_styles_ui_patterns') but I am not 100% sure... Would it better to test the existence of the plugin ID itself instead?

pdureau’s picture

Assigned: mogtofu33 » pdureau
Status: Needs review » Needs work

Just a little something to check

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs work » Needs review

I took back the ticket because i get the same "plugin not found" fatal error with the patch applied, if don't rebuild the cache after

$ ddev drush en ui_styles_ui_patterns

So i used sourceManager->hasDefinition('ui_styles_attributes') instead of moduleHandler->moduleExists('ui_styles_ui_patterns'). It is still necessary to rebuilt the cache, but at least it doesn't throw a fatal.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed c4173dd7 on 1.0.x authored by pdureau
    fix: #3622602 Style panel: missing ui_styles_ui_patterns plugin
    
    By:...