Steps to reproduce:

1. Install Drupal with minimal profile (I installed Drupal 9 beta, but it should still fail with D8)
2. Throw Olivero under /themes
3. Navigate to admin/appearance and click the "install and set default" link.
4. Watch the site error out.
5. Dblog gives this error:

Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by <em class="placeholder">olivero</em> have unmet dependencies: <em class="placeholder">block.block.olivero_search_form_narrow (search), image.style.olivero_hero (image)</em> in Drupal\Core\Config\UnmetDependenciesException::create() (line 98 of /Users/mherchel/sites/drupal-9.0.0-beta2-minimal/core/lib/Drupal/Core/Config/UnmetDependenciesException.php).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mherchel created an issue. See original summary.

mherchel’s picture

Title: PHP error when enabling Olivero when in Minimal profile » PHP error when enabling Olivero when with minimal profile
Issue summary: View changes
brianperry’s picture

Assigned: Unassigned » brianperry

Currently taking a look at this one...

brianperry’s picture

Assigned: brianperry » Unassigned
Status: Active » Needs review
FileSize
815 bytes

Attached patch moves search blocks and image style to optional install config which allows Olivero to be installed with the minimal profile.

There are probably a few things that should be cleaned up to improve the experience when enabling Olivero after a minimal install, but that seems to be out of the scope of this. I'll create issues - the most obvious one is that only the secondary menu displays, but the divider style is still used.

Also briefly looked at making search and image dependencies of the theme because that is a thing now: https://www.drupal.org/project/drupal/issues/474684 As it turns out, while you can define these dependencies, you can't yet force them to be installed: https://www.drupal.org/project/drupal/issues/3100374 Enabling search and image probably wouldn't be in the spirit of the minimal profile anyway...

andypost’s picture

Themes could require modules now, but agree that search is often replaced by search_api so better put search block to optional config

thejimbirch’s picture

Version: » 8.x-1.0-alpha1
Status: Needs review » Reviewed & tested by the community

Wonderful solution @brianperry!

Since Minimal doesn't have Search and Image, it makes perfect sense to make them optional and have Olivero preserve the "minimal" experience.

Marking at RTBC

MaxPah’s picture

Hello,

I confirm that I also have the error on Drupal 8.8 and the patch in comment #4 corrects this issue well.

Thanks for the patch.

viappidu’s picture

If the search module is not enabled we don't need to load the library either.
I simply added a checkbox on theme-settings, enabled only if the search module is installed
Thought as the easiest solution to avoid the script being loaded and giving an error.

Though I think it would be beneficial to use the block and library for the search_api module too. Wouldn't it be?

viappidu’s picture

Status: Reviewed & tested by the community » Needs review
mherchel’s picture

Status: Needs review » Reviewed & tested by the community

I'm going to commit the patch in #4. That being said, I agree that we shouldn't be loading unnecessary JS or libraries.. but I also want to avoid another theme setting (if possible).

I'm going to open up a followup issue for that.

mherchel’s picture

mherchel’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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