In #2638116: Clean up caching of Index class method results (especially fields), we unified the storage of all three index plugin types (datasources, processors, tracker). In doing so, we put a "middle layer" between the top-most array, keyed by plugin ID, and the actual plugin settings, originally because processor weights weren't inside the settings. Since we later changed that, I think the middle layer is now unnecessary again and should be removed.

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Issue tags: +Release blocker
drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new29.38 KB

This should implement it, and at least the PhpUnit tests pass for me, locally.
The only non-trivial change is this place in \Drupal\search_api\Plugin\search_api\datasource\ContentEntity::getIndexesForEntity():

    $index_names = \Drupal::entityQuery('search_api_index')
      ->condition('datasource_settings.*.plugin_id', $datasource_id)
      ->execute();

Without the extra plugin_id key, I don't think we can do this anymore. Or is there some entity query whiz who knows a solution?
Like it is, I think we'll have to load all indexes and check them manually. (Not that this should matter much, I'd expect very few sites would have more than one or two indexes.)

drunken monkey’s picture

Status: Needs review » Needs work

Wanted to quickly get this in before, but now we need an upgrade path.

borisson_’s picture

Issue tags: +Needs upgrade path

Tagging for upgrade path.

drunken monkey’s picture

Status: Needs work » Needs review
Issue tags: -Needs upgrade path
StatusFileSize
new2.81 KB
new32.45 KB
drunken monkey’s picture

StatusFileSize
new32.6 KB

Re-roll.

Status: Needs review » Needs work

The last submitted patch, 7: 2656052-7--remove_extra_layer_in_plugin_settings.patch, failed testing.

borisson_’s picture

Status: Needs work » Reviewed & tested by the community

Yep, this all looks great! If we can get the tests to pass again, this has my stamp of approval.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 2656052-7--remove_extra_layer_in_plugin_settings.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new532 bytes
new32.38 KB

Not sure how this happened, but this should fix it.

  • drunken monkey committed 5ab109a on 8.x-1.x
    Issue #2656052 by drunken monkey: Removed the "plugin_id"/"settings" sub...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Ah, finally green again!
Thanks also for your review, Joris!
Committed.

Status: Fixed » Closed (fixed)

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