Right now, the weight of the various processors correctly get set in the index configuration when the index is saved, but
- it's not taken into account when actually processing the items
- it's not taken into account when the form is displayed again, falling back to the default weight, making it easy to lose the processor weight by only resaving the form (easy to reproduce by toggling the "show row weight" options, changing the weight of a few items manually, and clicking save)
Attaching a patch to fix those.
Probably highlights the fact that #2656038: Make storage of weights a concern of the processor itself would definitely help from a DX point of view :-)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2724833-10.patch | 1.67 KB | drunken monkey |
Comments
Comment #2
DeFr commentedComment #5
DeFr commentedShould be better.
Comment #7
DeFr commentedSeems like the branch is randomly failing on PHP7 & PostgreSQL based on https://www.drupal.org/pift-ci-job/281193 and the patch. Asked for a re-test and it passed, so setting back to needs review.
Comment #8
borisson_Comment #9
NerOcrO commentedWorks fine for me!
Comment #10
drunken monkeyGreat job, thanks for reporting this and already providing a patch!
The patch looks pretty good, too – however, we never use the
processor_settingsproperty directly except when saving the index or freshly loading the processors.Revised patch attached, if that's still OK with you I'll commit it.
Comment #11
DeFr commentedLooks fine to me.
Comment #12
NerOcrO commented+1
Comment #14
drunken monkeyOK, great, thanks for the feedback!
Committed.
Thanks again, everyone here!
Comment #16
rgpublicHm. I've just installed 8.x-1.0-alpha16+28-dev by typing "drush up drupal-8.x-1.x-dev". Should this bug be fixed with this or not? Because it seems the bug isnt fixed for me and the patch #10 doesnt seem to apply anymore. My It's unfortunately *very* confusing to use the SearchAPI processors without any fix, though, because there is no way to find out the true order of all the processor items. I can swap for example two items in the list and click on save. The page is reloaded and the items are ordered like they were before the change. But: The order seems to be saved and honored. For example, when I try to swap the items again I get the message: No changes. I'm fighting for quite a while with this bug, so any ideas are highly welcome...