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.
Drupal 5.1, Workflow 5.x-1.0b1
I have a workflow with two states: Draft and Publish. It simply toggles the published flag and touches the date, but the default is Draft and unpublished.
When I go to the Workflow tab and set the state to Publish and schedule it for tomorrow (without entering a time), Workflow changes the state instantly. Watchdog gets a lot of errors similar to:
- Illegal offset type in /home/ahknight/www/drupal-5.1/modules/taxonomy/taxonomy.module on line 1154.
- Illegal offset type in /home/ahknight/www/drupal-5.1/modules/taxonomy/taxonomy.module on line 1151.
- Illegal offset type in isset or empty in /home/ahknight/www/drupal-5.1/modules/taxonomy/taxonomy.module on line 1150.
The database is an upgrade from 4.7 which is where this workflow was created.
Comment | File | Size | Author |
---|---|---|---|
#47 | path_tid.patch | 388 bytes | dgtlmoon |
#33 | pathauto_value_cast.patch | 1.39 KB | andremolnar |
#19 | pathauto_node.inc__0.patch | 652 bytes | freeman-1 |
Comments
Comment #1
gregglesI believe this is actually a pathauto problem: http://drupal.org/node/92900
Comment #2
mfredrickson CreditAttribution: mfredrickson commentedThe watch dog errors might be pathauto's, but workflow claims the problem that scheduling d/n work.
This will be fixed in the next 5.x release of workflow.
Comment #3
gregglesComment #4
gregglesapparently this is _already_ committed. yay fixes!
Comment #5
superfly CreditAttribution: superfly commentedThis is apparently fixed, but it still doesn't work for me. I thought it might be related to another issue, that being that the node I'm trying to get through the workflow was created before the workflow was assigned, and I even changed the code to match the change there, but still nothing is happening. I'm still getting those errors.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1154.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/ioltechnology/modules/taxonomy/taxonomy.module on line 1154.
Comment #6
superfly CreditAttribution: superfly commentedSorry, forgot to post the other details..
Drupal 5.1
PHP 4.4.2-1.1
Apache 2.0.55
MySQL 4.1.15
Comment #7
gregglessuperfly - it would be more relevant to know the version of pathauto that you are using.
Also - are you using category or localizer?
Comment #8
superfly CreditAttribution: superfly commented*sigh* it must be that older nodes thing... just created a new node and the system works fine.
Comment #9
superfly CreditAttribution: superfly commentedai, it seems i'm good at counting my chickens before they've hatched. This still doesn't work. My workflow updates correctly, but I still get those "taxonomy" errors. I'm using workflow 5.x-1.0 and pathauto 5.x-1.0. I'm not using category or localizer.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1154.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/mysite/modules/taxonomy/taxonomy.module on line 1154.
Comment #10
gregglessuperfly - can you try upgrading to the 5.x-1.x-dev version of pathauto and also can you see if the problem still exists without the workflow module?
Comment #11
superfly CreditAttribution: superfly commentedgreggles, this is happens when i update the workflow. i have a number of other sites running pathauto, and it doesn't happen there. only on this one site which is running the workflow module. also, the upgrade to dev didn't help.
Comment #12
codepoet CreditAttribution: codepoet commentedI'm in the same boat as superfly with the dev version, FYI.
Comment #13
gregglesso then we need an active status ;)
Comment #14
gregglesNodes created via blogapi seem to have this problem as well: http://drupal.org/node/129382
The solution I plan to follow is to use the new DRUPAL-5--2 branch to implement token.module and then let token.module handle this.
I'll post back as I get closer on that so that you all can test.
Comment #15
freeman-1 CreditAttribution: freeman-1 commentedHi,
I run Drupal 5.1 with pathauto 5.x-1.0 and Taxonomy enabled. I ran into this problem as well - things work, but watchdog keeps logging "illegal offset in isset or empty" errors in the taxonomy module. I tested with pathauto 5.x-1.1 and the problem exists as well.
A debug trace shows the problem with the call from pathauto_node.inc:214 :
Seems the issue lies with the $value variable in the code above line 214. In my run, $value is an object type - and there's no handling for objects in the code. So I added this snippet at line 202 :
before the existing array-handling part :
And it looks like the object type version is now handled correctly.
Things still look a little hard-coded to me, I'm not sure if it works for nodes with multiple taxonomy terms.
Comment #16
gregglesfreeman (and everyone else who hasn't) please upgrade to the 1.1 release of pathauto or even the 1.x-dev version. It includes several bug fixes which should help. Then, if you still have the same error, please confirm it in this issue.
thanks.
Comment #17
freeman-1 CreditAttribution: freeman-1 commentedGreggles, I did upgrade to 1.1 and the problem persisted. I've applied the same snippet to 1.1 and it resolves the issue. Thanks.
Comment #18
gregglesOk, I just wanted to make sure.
Can you provide it as a patch to make it easy for others to test? http://drupal.org/diffandpatch
Thanks.
Comment #19
freeman-1 CreditAttribution: freeman-1 commentedSure. Here is the patch against 1.1.
Comment #20
gregglesGreat - now we just need a review - since this is an issue that is quite complex (due to the nature of taxonomy terms and the possible configuration options for them) I'd appreciate it if lots of folks could test out this patch.
Thanks!
Comment #21
gregglesAnd in case anyone is unclear on the steps to review this:
1) install pathauto 5.1.1 and apply this patch
2) configure a pattern for your nodes that involves vocab/catetgory/catpath etc.
3) create nodes
4) see if you get the right paths (without errors)
Comment #22
simplymenotu CreditAttribution: simplymenotu commentedTesting results :
pathauto 5.x-1.1 and the above patch created vocab/terms appropriately.
/vocab/term/sub-term
Vocabs tested :
free tagging
single, optional
single, required
multiple, optional
multiple, required
Comment #23
gregglesthanks simplymentou! I'd still like some more testing/reviews prior to committing, but I do very much appreciate your help.
Comment #24
simplymenotu CreditAttribution: simplymenotu commentedPosting testing notes per greggles on IRC
1. install pathauto 5.x-1.1
2. apply patch
#19 submitted by freeman on March 29, 2007 - 11:00 new
Attachment: pathauto_node.inc__0.patch (652 bytes)
3. config vocab
* The configuration options have been saved.
* Bulk update of terms completed, 6 aliases generated.
4. create vocab
freetagging
5. add term "term 1"
* Created new alias nodes-freetag/term-1/term-1 for taxonomy/term/7
* Created new term term 1.
6. create a page
freetagging terms
- term 1 (found term)
- something else
- nada
* Created new alias nodes-freetag/something-else/something-else for taxonomy/term/9
* Created new alias nodes-freetag/nada/nada for taxonomy/term/10
* Created new alias http-drupal-org-node-123001 for node/54
* Your Page has been created.
7. create vocab
multiple select
8. create page
multiple and freetag used
* Created new alias nodes-freetag/test/test for taxonomy/term/17
* Created new alias my-office-home for node/55
* Your Page has been created.
9. create page with freetag term the same as multiple-select term
* Created new alias nodes-freetag/chair/chair for taxonomy/term/18
* Created new alias nodes-freetag/chair-freetag/chair-freetag for taxonomy/term/19
* Created new alias office-chair for node/56
* Your Page has been created.
10. create vocab
single, required
single, optional
11. create page with single vocab
no issues
Comment #25
Soren Jones CreditAttribution: Soren Jones commentedI was getting the same error superfly reported in #5/#9 with Drupal 5.1, Workflow 5.x-1.1, and Pathauto 5.x-1.1 when updating the workflow state on an item with one two-state workflow.
I am not using Category. I am using Localizer 5.x-1.9.
I applied freeman's pathauto_node.inc__0.patch from #19 and am no longer getting the error.
Thank you.
Comment #26
Hetta CreditAttribution: Hetta commentedStill a problem in pathauto 5.x-1.2, with drupal 5.1
I added the code snippet given by freeman in #15, which fixed the problem.
Thanks!
Comment #27
patchak CreditAttribution: patchak commentedI can confirm that the patch solved the problem with me too!
Thanks
Comment #28
rootworkPatch worked for me too. Yay!
Comment #29
gregglesFor the people testing and responding that it works for you - can you also state what kinds of tests you did?
Thanks.
Comment #30
patchak CreditAttribution: patchak commentedI installed pathauto and was getting that taxonomy error every time I blocked a feed source from leech with the content blocker module. While searching for that error I found this issue..and I figured I could give it a shot..
I installed the latest pathauto 5.x (not pathauto 2) and applied the change, now the error is gone and I have so side effect at all. I tried to update all my paths and create some new node paths to test it out, and yet the error seems gone!
Patchak
Comment #31
mwander CreditAttribution: mwander commentedThis is my first review. Please bear with me. (Plus I think my situation was a bit different than some of the others above.)
Situation was that I had previously been running cron against nodes in a Drupal environment with Scheduler, Pathauto, and Taxonomy.
Following running cron, if any changes were made to the nodes that related to these modules, I received many of the error messages listed above (only on the first view of the site after running cron).
Installed patch on Pathauto 5.x-1.2. Corrected all error messages.
Much thanks!
Comment #32
andremolnar CreditAttribution: andremolnar commentedDuplicated the error with workflow 1.1 and pathauto 1.2.
The node with workflow in question was using an optional free tagged vocabulary as well as a required multi-select vocabulary (no hierarchy)
When workflow published the node a series of offset warning (line 1150, 1151 and 1154 of taxonomy.module) are displayed.
It makes no difference whether or not any free tagged terms were entered.
Applied the patch -
Followed the same workflow path as before and all errors no longer appear.
Seems to do the trick for me.... BUT
I haven't dug/traced through the code thoroughly to see if $value is every even possibly an array. I actually think that it might never be an array if its source is the $node->taxonomy object. If there are some situations where $value somehow manages to be an array - then an alternate solution would be to cast the variable as array rather than do the extra conditional to assign $tempid.
Regardless the code patch needs to be re-written to not duplicate the four lines of code:
Comment #33
andremolnar CreditAttribution: andremolnar commentedActually just took a closer look at the code - and the same sort of casting I suggest is being done at line 169/170
So with that in mind I propose the attached patch - which checks if value is an object - and if it is casts it as an array. And in the above two lines takes that casting out of the for loop (so the casting isn't done each and every time).
Tested under the same conditions mentioned above - seems to work just fine. But more testing would be required.
andre
Comment #34
gregglesI believe it is an array when the node is a new node that has been created manually. It's only an object when using a module like leech or workflow or...
I do agree that I'd like to see more testing/reviews of the code.
Comment #35
andremolnar CreditAttribution: andremolnar commentedIf that is the case - then the new supplied patch *should* be fine. If $value is an array - it stays an array - if its an object, it becomes an array. If it is anything else (e.g. string) - it stays the same.
I've got my patch employed on a dev server with tests happening constantly. I'll try to keep you updated if anything strange starts happening. But so far it is holding up.
andre
Comment #36
tjharman CreditAttribution: tjharman commentedI was having problems with the illegal offset errors, only triggered when I installed the fasttoggle module.
Installing the patch in #33 has resolved the errors for me.
Thanks,
Tim
Comment #37
kaimuki CreditAttribution: kaimuki commentedI just downloaded PathAuto 5.x-1.2 yesterday, and today got the error messages below.
I'm a newbie, and have read through all the couple bug threads, and am not sure if the problem
is fixed in 5.x-1.2, or do I still have to apply some sort of patches?
I am running localizer, and none of the other stuff that seemed to have caused some others problems. I get the error message when clicking "create translation" so I'm pretty sure it's a localizer related situation.
My site is under construction, so I'm willing to give access to someone if they want to see what is going on and turn on/off some modules, etc. Or run a test if someone gives me some instructions on what they want done.
Aloha,
kai
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1154.
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /home/uchinan/public_html/modules/taxonomy/taxonomy.module on line 1154.
Comment #38
kaimuki CreditAttribution: kaimuki commentedI applied the patch in #33, and it seems to have got rid of the error messages.
I'll report back if there is any other odd behavior.
Thanks.
Comment #39
Anonymous (not verified) CreditAttribution: Anonymous commentedI had the same scenario as #36 where Pathauto was working just fine until I installed fast toggle.
I saw the errors that have been described many times already in this thread, applied patch from #33 and I can confirm that it fixed the errors and everything works great again.
Thanks,
txcrew
Comment #40
beginner CreditAttribution: beginner commentedcouldn't apply the patch because it has non-standard (UNIX) end of lines.
See guidelines: http://drupal.org/patch/create
FYI, the same error (illegal offset) occurs with me when I enable pathauto and use it together with a custom module which uses node_load().
I don't use any of the other modules mentioned in this thread, so the common denominator is definitely pathauto.
Comment #41
gregglesWhile it would be nice to have the proper EOL all the time I'll still quite happily accept patches that fix problems.
Applied to 5.x-1 branch. Thanks!
Comment #42
(not verified) CreditAttribution: commentedComment #43
dgtlmoon CreditAttribution: dgtlmoon commentedgetting the same error in 4.x but this patch wont fit the 4.x release
any ideas?
is this still related to the typecasting bug here
http://drupal.org/node/155515
Comment #44
dgtlmoon CreditAttribution: dgtlmoon commentedComment #45
gregglesIt probably is. I suggest you manually port the patch and that will tell you.
Otherwise, you really should upgrade soon. Once 6.x is out there will no longer be support for 4.7.
Comment #46
greggles@dgtlmoon - was your issue solved by http://drupal.org/node/104905 perhaps?
Comment #47
dgtlmoon CreditAttribution: dgtlmoon commentedafter the most recent patch to 4.x-dev $first_term_id is still returning an object
im surprised $term = taxonomy_get_term($first_term_id); on line 216 doesnt return an error because that function is expecting an integer
i get this error when ever i transition a workflow state on a node.
see attached patch
Comment #48
greggles@dgtlmooon - sorry, I'm not supporting 4.7 any more and nobody else has tested this so I'm marking it closed to clean the queue.
If you'd like to become the maintainer of the 4.7 branch I'd be happy to give you permissions. Just contact me directly.