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.

CommentFileSizeAuthor
#11 164464_tokenize_new_stdclass.patch634 bytesgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brahms’s picture

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

$node = stdClass;

with

$node = new stdClass();

Street-1’s picture

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

OliverColeman’s picture

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.

functions’s picture

This fix also resolved this issue for me.

Linulo’s picture

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

scor’s picture

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

doc2@drupalfr.org’s picture

SocialNicheGuru’s picture

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

laken’s picture

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!

greggles’s picture

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

greggles’s picture

Status: Active » Needs review
FileSize
634 bytes

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

greggles’s picture

@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

greggles’s picture

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!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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