I have drupal 5.0 installed and tried to activate this module. I get the following error message:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /usr/www/users/ceo3141/modules/og_content_type_admin/og_content_type_admin.module on line 659
I cannot even get back to my website Admin page to deactivate the module.
Help!
Thanks.
Comments
Comment #1
rconstantine commentedHoly crap! That's not good. I'm looking into it right now...
...line 659...is...
$activated_types = unserialize(db_fetch_object(db_query($sql))->types_active);Hmm. I don't have a problem with this line, but you can see the T_OBJECT_OPERATOR reference. What version of PHP are you running? I'm using 5.2.0.
If you can confirm an incompatibility there, I'll go ahead and change that one line into two:
and see if that fixes it for you. Feel free to try this change yourself and report back.
Comment #2
ceo3141 commentedMy webhosting company uses PHP 4.3.10. When I searched the forums for similar error messages, I saw that some modules req. PHP 5 -- before I change anything, do you think that is the problem?
I am fairly new to drupal, and am just learning php, too. If my php version is not the problem, let me know if I should just go ahead and change that line into the 2 you suggested and reinstall the module -- sorry for being green . . .
Your quick reply was very much appreciated!!
Comment #3
rconstantine commentedA quick look on php.net seems to support the idea that V4 of PHP can't handle the "->types_active" portion of the line in question, so changing to the two line version I've outlined should make it work. There were a few mentions regarding the offending portion not liking to be inside paranthesis. So try it; it should work.
Otherwise, if you still can't log into your site, you can ftp in and delete the module file, then delete the table from your DB by hand with whatever tool your host gives you. You should read the install file if you have to delete things by hand and make sure you execute (by copying and pasting into your DB tool) the uninstall commands since the install does modify the {blocks} table. Also, you'll want to delete entries made to {system} and {menu} that reference the module.
Of course, the best solution is that if the change of the code works, then you won't have any more problems (hopefully). I hope this helps.
Comment #4
ju.ri commentedhi,
my installation brought up the same error message. the php version is 4.3.10.
i found the code above two times in the module and substituted each by the suggested two lines.
the module is still not functioning, but the error message changed:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /srv/www/***/sites/all/modules/og_content_type_admin/og_content_type_admin.module on line 728
(that is after inserting to lines of course)
could you help me with this? I also cannot upgrade my php...
your module would be extremely useful for my site!
Comment #5
rconstantine commentedceo3141 had emailed me privately and i think we resolved it. yes there is a third line of code to change if using php 4. there is one difference in the third line. instead of just "db_query($sql)" in the heart of it, there are arguments after the "$sql" part. I'm not in front of the code right now, but it should go something like:
$activated_types = unserialize(db_fetch_object(db_query($sql, $num))->types_active);into
that's how i recall it anyway. let me know if that does the trick.
Comment #6
ju.ri commentedthanks a lot that did it!
it was the exact code by the way :)
Comment #7
rconstantine commentedfixed in dev version. a new release should show up whenever drupal.org's cron job runs for that.
Comment #8
(not verified) commentedComment #9
Electrocat commentedYou did get the fact that the line repeats 3 times
Comment #10
rconstantine commentedOf course. Actually, that specific line is repeat once more, and then the third one is a slight variation. Make sure you use the dev version.