Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As a workaround for #2798641: Index can get created before fields, I tried to add enforced dependencies on my field configs in an index. The idea of those is that re-calculating dependencies doesn't drop them:
dependencies:
config:
- ...
module:
- search_api
- node
enforced:
config:
- ...
This however causes notices because it is assuming that those keys are strings when it shuffles them around:
Illegal offset type Index.php:1541
Comment | File | Size | Author |
---|---|---|---|
#2 | 2798643-2--mind_enforced_dependencies.patch | 1.44 KB | drunken monkey |
|
Comments
Comment #2
drunken monkeyThanks for reporting this problem!
The attached patch should fix this, quite simply. I don't think we need to include the "enforced" dependencies in the return value of
getDependencyData()
, since there's no way to do anything about them inonDependencyRemoval()
anyways – so we just need to ignore it there, and include it manually incalculateDependencies()
(I think).Please test/review!
Comment #3
borisson_I haven't tested it, but looking at the code, this should resolve the issue.
Comment #5
Nick_vhThanks. Committed and checked of with Berdir and Borisson_