I recently noticed that my TagOrder module stopped working. Specifically, The tags were never in the order they were intended to be.
After looking into the code, I found specifically that there was a single point of failure.
There was a check for "$node->taxonomy['tags'][$vocabid]"
This code returned false, not because the 'tags' didn't contain any vocabulary matching vocabid, but because 'tags' itself returned null.
That being said, the taxonomy itself was not empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | tagorderfixed-1462030-2.patch | 2.46 KB | mwisner |
| #3 | tagorderfixed-1462030-3.patch | 2.46 KB | jrstmartin |
Comments
Comment #1
mwisner commentedThe attached patch should resolve the current issues with tagorder.
Edit: Use updated patch in comment #3!
Comment #2
jrstmartin commentedThank you so much! Works! D6.25, tagorder 6.x-1.5
Edit: Ouch. Yeah it works but changes all form IDs in the
<form>tag, for example<form id="node-form"changes to<form id="1"and will break lots of themes and who knows what else.Comment #3
jrstmartin commentedOh. Just a syntax error.
$form['#id'] == 'node-form'. New patch attached.Comment #4
mwisner commentedOhh man, sorry about that.
Thanks for the find!
Comment #5
perlgal commentedThe patch in #3 works!
Many Thanks.
Comment #6
wstopa commentedFor those of you who have upgraded to 6.29, I've found that the following line needs to be modified slightly. I'm unsure if this is directly related to the form API change or not.
I noticed that when calling array_unshift($form['#submit'], 'tagorder_submit_alter'), the callback tagorder_submit_alter is never executed. Replacing "#submit" with "#validate" seems to solve this problem.
Current: array_unshift($form['#submit'], 'tagorder_submit_alter');
New: array_unshift($form['#validate'], 'tagorder_submit_alter');