I was going to use the Subscriptions-module to notify forum users about the latest content, but unfortunately as soon as I enable Subscriptions-module, I can't see any comments anymore. Links for comments stay visible and new links for subscriptions are also available. After clicking a comment link, there is only an empty page. I don't get any error messages.
This applies not only to the forum content, but also other comments on the site. After I disable the Subscriptions-module, all comments written become visible again. Also, if the module is enabled and there is an attempt to reply to a forum topic, "Preview"-button generates only an empty page with content "".
I searched Drupal forums, but didn't overcome with this issue. I also tried re-importing relevant tables from the subscriptions.mysql. I have the Drupal 4.7.2 installed, the database is MySQL 4.1.12 and PHP 5.1.1.
I have ecommerce, image and locale modules installed. Enabling/Disabling these didn't cure the issue. Still, the fact I didn't find others having this problem leads me to believe the problem is because of modules I have installed or could it be because of PHP 5?
Best Regards,
-repe
Comments
Comment #1
dziemecki commentedHmm. Might be PHP 5 - I don't test against it, but the APIs I'm using supposedly have been. That's gonna be tough to address without an error message. Can you turn on "display_errors" for PHP (possibly in your htaccess)?
Comment #2
repe-1 commentedUnfortunately I don't have access to modify php.ini, but this is what I found in the server log:
I have several entries about this "mhash.so" library and I should take a look why this happens...
[Sat Jul 15 12:47:09 2006] [error] [client 82.181.82.184] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mhash.so' - libmhash.so.2: cannot open shared object file: No such file or directory in Unknown on line 0, referer: http://www.plusnapa.fi/dp/?q=forum/16
...but this is the error message for the subscriptions.module when I tried to view a post in the forum and got an empty screen:
[Sat Jul 15 12:47:10 2006] [error] [client 82.181.82.184] PHP Fatal error: Cannot use object of type stdClass as array in /var/www/html/dp/modules/subscriptions/subscriptions.module on line 540, referer: http://www.plusnapa.fi/dp/?q=forum/16
PHP error, indeed. A solution for similar error is presented for WordPress here: http://wordpress.org/support/topic/12138. I used the same idea and changed line 540 FROM $nid = $comment['nid']; TO $nid = $comment->nid;
This cures the issue and I don't get an empty screen anymore.
However, when I tried to add a new reply to a forum message, I got this warning for each messaged I had already added:
# warning: Invalid argument supplied for foreach() in /var/www/html/dp/modules/node.module on line 359.
# warning: implode() [function.implode]: Bad arguments. in /var/www/html/dp/modules/node.module on line 363.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /var/www/html/dp/includes/database.mysql.inc on line 120.
Still the reply was added correctly. After disabling subscriptions module, I don't get those warnings so somehow this new problem is also related to subscriptions module, I think. Maybe there are other object references that should be changed to another form like I did for the $comment->nid.
br,
-repe
Comment #3
dziemecki commentedIf you're running your site on an Appache server, you don't need access to php.ini to turn error display on. Open up ".htaccess" in the root of your website and add this line:
php_value display_errors 1When you're done testing, you can turn it off by prepending a "#":
# php_value display_errors 1or changing the value to "0"
php_value display_errors 0The other errors you posted are too low level for me to address - they aren't (necessarily) happening anywhere near my code.
You can change the array notation to object notation, but I'm pretty sure it will essentially disable the module. At that point, you might as well unistall it.
Comment #4
dziemecki commentedI uploaded a new version of the module here:
http://drupal.org/files/issues/subscriptions_11.module
The key change is that I modified the comments hook to use object notation rather than array notation. It might work for you, since it appears that PHP 5 prefers objects
Comment #5
metzlerd commentedI had the same subscriptions.module error on line...
I verified that this works on PHP5. I'd recommend commiting this to 4.7, unless it's not backwards compatible with PHP4.
Thanks for the fix
Comment #6
dziemecki commentedCommitted.
Comment #7
dziemecki commentedI added an if/then clause to this because anything I did to fix it for 4.5 killed it for everything else. Now, the function uses whichever isn't null.
Comment #8
dziemecki commented