Problem/Motivation

Missing plugin errors are thrown during profile installation if:

  • example_profile/config/install/views.setting.yml contains any values for display_extenders, such as via exported settings from an installation that has modules providing a views display extender like views_ajax_history,
  • any profile dependencies modules have required config install files for views, eg. Redirect module,
  • and the modules providing the views display extenders are not installed early enough.

Steps to reproduce

  1. Create a profile that has module dependencies for: views, views_ajax_history, redirect
  2. Include in the profile an install config for views.settings.yml that includes the display_extender provided by Views Ajax History module:
    display_extenders:
      - ajax_history
    
  3. Do site installation with profile.

Proposed resolution

Unknown.

However, no errors are thrown if the display_extenders values in views.setting.yml are removed.

And, any other config/install/views.view.*.yml files that have ajax history settings are installed correctly.

Comments

drpldrp created an issue. See original summary.

drpldrp’s picture

Issue summary: View changes
drpldrp’s picture

Issue summary: View changes
larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

Do the display extender plugins déclaré config dependencies ?

Are the modules listed in the config dependencies for the view

drpldrp’s picture

No, the modules that provide the Views display extender plugins do not get added as a config module dependency in any views.view.*.yml.

larowlan’s picture

Status: Postponed (maintainer needs more info) » Active

I think the base extender plugin needs to implement ::calculateDependencies and at least add the plugin provider as a module dependency

lendude’s picture

Status: Active » Closed (duplicate)

#6 sounds like the way forward and sounds like what #2426607: Calculates and adds dependencies of views display extender is trying to fix, so marking this as a duplicate of that. If you feel that this is addressing a different issue, please feel free to reopen this.

neclimdul’s picture

Status: Closed (duplicate) » Needs review

I don't think this is a duplicate or at least it would drastically change the scope of the current patch.

I ran into what I think it this issue today with Scheduler.module using config install because it does some interesting things during install. Specifically it dynamically creates new views for scheduled entities.

https://git.drupalcode.org/project/scheduler/-/blob/6d7284decf69cc635908...

This dynamic creation saves the view which then triggers this code in views:
https://git.drupalcode.org/project/drupal/-/blob/40a02eb794798624d30dfa9...

The display plugin base code uses the global settings which then reference plugins which may or may not be installed yet. So even if you fix the uninstall process, i'm not sure it could handle this use case during the install process.

neclimdul’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#3336108: Don't run hook_modules_installed during config install

I guess schedulers process is maybe unsolveable in core without a huge refactoring of dependency logic or this view system.

#3336108: Don't run hook_modules_installed during config install is addressing the scheduler case which bundled with the other issue is probably good enough.

seanb’s picture

Status: Closed (duplicate) » Active

Just found that in my case the cause was #3570975: Site install fails due to message in maxlength.install.
Any Url::fromUri() call in an install hook can cause the views route subscriber to trigger and result in this vague error.

Maybe there is a way to protect site install against this?

quietone’s picture

Version: 9.4.x-dev » main
Issue tags: +Needs issue summary update

Based on the last comment, I suspect this should be on main, not an unsupported version. This needs an issue summary update, so tagging for that.