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

Amitaibu - August 4, 2007 - 08:14
Project:Tokenize
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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.

#1

brahms - August 6, 2007 - 15:23

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

$node = stdClass;

with

$node = new stdClass();

#2

Street - August 17, 2007 - 03:23

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

#3

Oliver Coleman - November 30, 2007 - 03:22
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

functions - December 2, 2007 - 19:57

This fix also resolved this issue for me.

#5

Linulo - February 5, 2008 - 14:37

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

#6

scor - March 10, 2008 - 12:16

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

#7

doc2@drupalfr.org - March 26, 2008 - 18:57

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

#8

SocialNicheGuru - April 10, 2008 - 01:21
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

laken - June 19, 2008 - 22:37

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

greggles - June 20, 2008 - 00:25

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

#11

greggles - June 21, 2008 - 17:33
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

greggles - June 21, 2008 - 17:44

@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

greggles - June 23, 2008 - 21:12
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

Anonymous (not verified) - July 7, 2008 - 21:14
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.