Download & Extend

"Attempt to assign property of non-object in..."

Project:Tokenize
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi
After installing this module I got:

warning: Attempt to assign property of non-object in C:\wamp\www\drupal\modules\tokenize\tokenize.module on line 21.

Comments

#1

I think you have to replace the code in line 21:

$node = stdClass;

with

$node = new stdClass();

#2

I got the same error. Making this change to the code fixed the problem for me too.

#3

Title:Error on Installation» "Attempt to assign property of non-object in..."

Tried the fix in #1 but to no avail.
It's an intermittent problem for me, not sure what triggers it, and it's occurring not just during installation.

#4

This fix also resolved this issue for me.

#5

brahms' fix worked for me, too.
Thank you.

#6

That works for me too. Please commit this fix. A stable release should not contain such an error.

#7

Referencing issue: http://drupal.org/node/234600

#8

Priority:normal» critical

After making the change above, the initial error goes away, but I get this error now.

warning: Invalid argument supplied for foreach() in
/html/sites/all/modules/tokenize/tokenize.module on line 94.

I chose to use tokens in a CCK link field that i created in a node profile

Link name:
View my profile

Default value
user/[author-uid]

I chose to "replace on node submission"

it saves.

I got to my profile and it gives me the above error on line 94

line 93 $fields = tokenize_get_settings(NULL, $node->type);
line 94 foreach($fields as $field => $method) {

What needs to be changed to make it work?

Thanks, Chris

#9

Same problem as activleyOUT. It looks like the tokenize_get_settings function is not returning a valid array when it's called, but I don't totally understand the code. Can anyone help here?

Thanks!

#10

subscribing...I'd like to see this module working.

#11

Status:active» needs review

Here is a patch to fix the initial problem - now to fix the problems described by activelyOUT and alaken.

AttachmentSize
164464_tokenize_new_stdclass.patch 634 bytes

#12

@activelyOUT and @alaken - I'm not able to reproduce the problem as you have described it.

Also, please be sure to use the CVS HEAD code rather than the 5.x-1.0 release. There have been several changes since 5.x-1.0 to the HEAD which are not reflected in a release tarball. I know that's kind of a pain and I've asked to be a comaintainer of this module #272988: status of module (and offer to co-maintain), but until we have a resolution I don't want to create a 5.x-1.x-dev release.

Can you try the patch I've provided here and then see if you still have problems.

I did find that I had to add my field, tokenize enable it, save it, then "configure" the field again, make no changes, and save it to get it work. #273294: fields must be edited twice before tokenizer works

#13

Status:needs review» fixed

Morris responded on my issue agreeing to my proposal, so this is now fixed. If you wait 12 hours you'll be able to download the 5.x-1.x-dev.tar.gz file which I created which will contain this and several other changes. I hope that if you used Tokenize in that past and were turned off by this bug that you will give it another chance ;) (but not for 12 hours until the repackager runs). Thanks, folks.

Thanks, Brahms, for the suggestion that fixed it!

#14

Status:fixed» closed (fixed)

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

nobody click here