Hello,

I am testing the alpha 5 version of facets.

I have facets with the dependency on a search API view.

Before the update, in the config file, the dependency was:

dependencies:
  config:
    - views.view.search

After updating, I delete the facets and recreate its, and now the dependency is:

dependencies:
  config:
    - views.view.search__page_1

This view does not exist so if I rebuild my website, it is broken.

I don't know if I would have time to investigate and made a patch.

Thanks for any help.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Grimreaper created an issue. See original summary.

Grimreaper’s picture

borisson_’s picture

    $plugin_id_array = explode(':', $this->pluginId);
    $dependencies['config'] = ['views.view.' . $plugin_id_array[1]];

This is the current code in SearchApiViews::calculateDependencies, we have to make sure that everything after __ is not in there anymore. I think we can also write a test for that. Bingewatching Luke Cage now, when it finishes - I'll have a look at this.

borisson_’s picture

Status: Active » Needs review
FileSize
685 bytes

This should help, can you confirm?

Status: Needs review » Needs work

The last submitted patch, 4: wrong_dependency-2809921-4.patch, failed testing.

The last submitted patch, 4: wrong_dependency-2809921-4.patch, failed testing.

borisson_’s picture

Status: Needs work » Needs review
FileSize
670 bytes
688 bytes

Should fix test fails

StryKaizer’s picture

After a long debugging session, it turns out that dependencies are only calculated once you save the config entity.

So above patch works, but you need to
- resave all facet sources
- then resave all facets

in that order...

stephen-cox’s picture

Patch #7 works. Thanks.

I needed to resave all the facet sources and facets after applying the patch and then export the new config. After that it was possible to import new config.

  • borisson_ committed e1b59b4 on 8.x-1.x
    Issue #2809921 by borisson_: Wrong dependency calculated for facets
    
borisson_’s picture

Status: Needs review » Fixed

Pushed this. Thanks for confirming.

borisson_’s picture

Grimreaper’s picture

Hello,

Sorry for the delay.

I have just tested the new facets version. Works perfectly. I can rebuild my site from scratch without problem.

Thanks you all.

Status: Fixed » Closed (fixed)

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