I just upgraded from 1.4 to 1.5 and added a new index to solr. The ability to add new sort fields went away in 1.5. I then upgraded to the latest dev version and the issue remained.
Going back to 1.4 solved the problem.
I then went through each commit from 1.4 to 1.5 and found that this patch ( draggable table sort is not respected on searchapi sorts admin page (2168301) ) created the issue. Specifically this block of code:
// Order fields according to sorts weight.
$new_fields = array();
foreach ($sorts as $key => $sort) {
if (!empty($fields[$key])) {
$new_fields[$key] = $fields[$key];
}
}
$fields = $new_fields;I commented it out and everything started working again. It lost the sorting ability on the admin table but I could add new sort fields. Just to be sure I un-commented it after adding a few sort fields and those existing fields remained and sorted but all of the other potential sort fields were missing.
I have run out of time to figure out the fix, but commenting this out or removing it fixes the admin issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | search-api-sorts-inability-to-add-fields-2202093-6.patch | 579 bytes | setvik |
Comments
Comment #1
wilei commentedI can confirm this bug. New index and no fields shown as sortable when using searchapi_sorts-7.x-1.5. After commenting those few lines out all sortable fields are shown.
Comment #2
Anonymous (not verified) commentedThanks will look into ASAP.
Comment #3
vintorg commentedCommenting out that block of code solved my issue: https://drupal.org/node/2213849
I now have fields show up in my table under the sorts tab.
Comment #4
philipz commentedThis patch makes those fields visible and they can be added but the order cannot be saved. This might be some other issue but I'm not sure.
Comment #5
Anonymous (not verified) commentedOk, committed to devx.
http://drupalcode.org/project/search_api_sorts.git/commit/2134fd1
Comment #6
setvik commentedDon't think this is fixed in latest dev yet.
Briefly tested the attached patch and it seems to work.
It should honor order of existing sort fields and allow new fields to be added.
Comment #7
crizBug confirmed. Highly critical, as it is also included in latest commerce kickstart release.
Patch #6 works for me.
Comment #8
malberts commentedPatch #6 works for me too.
I tried it with the latest Commerce Kickstart 2.14 (using Sorts 1.5) and with a custom build using Sorts 1.5 and Sorts dev.
Comment #9
Exploratus commented#6 worked for me. This really should get committed, dont really understand how such an important module can have such a critical bug outstanding for so long. It's unusable without it.
Comment #10
Anonymous (not verified) commentedI can't apply patch #6 to latest dev-x, seems different code.
Comment #12
dr.osd commented#6 worked for me.
Comment #13
tamnv commented#6 worked for me. Thanks
Comment #14
joelpittetFixed as of #11
Comment #16
dysrama commentedHow has this still not been put in a new release? The module effectively doesn't work for first time installs.
Comment #17
mouthofthesea commentedPatch #6 works for me.
Quote for dysrama.
Please put this patch in a new release, so you can save potentially a lot investigation time for the future developer that have to face with that problem.
Have a good day!
Comment #18
jennypanighetti commentedOh geez, this took me hours to fix! PLEASE post a new release with this patch!
Comment #19
Bill Choy commentedPlease create a new release with this patch. Its been over a years
Comment #20
evaldask commentedho ho.. some valuable hour wasted too :D
Comment #21
MariaWebIdeas commented#6 is perfect, thanks.
Comment #22
sawtell commentedThis is still not in a full release...
+1 for wasted time
Comment #23
shashwat purav commented#6 Worked for me.
Comment #24
Aambro commented#6 Worked for me. Using Commerce Kickstart 2 7.x-2.22
Comment #25
martijn de witIn version 7.x-1.6 the code is removed as the start post mentioned as temporary solution.
Why is the patch of #6 not applied instead ?!? Almost everybody mentioned that #6 was tested and worked.
#6 is also working fine for our installations.
Comment #26
strykaizer@Martijn de Wit #11 was commited in 1.6 and solves the issue. I can not reproduce the issue anymore since this was commited.
#14 also states that commit from #11 solved the issue for him.
If you still experience this issue with 1.6, can you provide me details on how to reproduce the issue, as I can not reproduce it myself.
EDIT: nevermind: I can reproduce the issue, fixing this in dev
Comment #27
fox_01 commented#6 worked for me
Comment #28
strykaizercan somebody please tell me what issue you still experience even when 1.6 is active?
If I can reproduce it, I can include #6 or similar in the next version, but at this moment I can not reproduce the issue described in the issue summary.
EDIT: nevermind: I can reproduce the issue, fixing this in dev
Comment #30
fox_01 commentedI had first installed 1.6 and saw nothing at the sorts tab.
Comment #31
strykaizerThanks all for your patience. The previous maintainer was not active any more, which made this issue a bit longer outstanding.
Committed, will be in 1.7 and now available in dev.
Comment #32
fox_01 commentedI tried to upgade by drush
Comment #33
strykaizerfox_01, can you give me the command on how you did that upgrade?
I just ran "drush dl search_api_sorts-7.x-1.x-dev", which works without issues.
Comment #34
fox_01 commentedi have installed 1.5 and executed "drush up -y search_api_sorts-7.x-1.x-dev"