Closed (fixed)
Project:
Counter
Version:
6.x-2.3
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2009 at 18:12 UTC
Updated:
2 Jan 2014 at 19:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
murokoma commentedGot the exact same problem here on a server that runs several drupal installations smoothly and without any known issues, so I don't think it's a server issue.
After clicking update, I got the following error messsage:
Updating
An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
An error occurred. http://www.XXXXXXXXXXX.com/update.php?id=21&op=do
Warning: Call-time pass-by-reference has been deprecated in /var/www/vhosts/XXXXXXXXXXX.com/httpdocs/sites/all/modules/counter/counter.install on line 185
Warning: Call-time pass-by-reference has been deprecated in /var/www/vhosts/XXXXXXXXXXX.com/httpdocs/sites/all/modules/counter/counter.install on line 186
{ "status": true, "percentage": 100, "message": "Remaining 0 of 1.\x3cbr/\x3eUpdating counter module" }
set this to critical b/c of the severety of the issue.
Comment #2
murokoma commentedAh, just to let you know, queries were executed, however:
The following queries were executed
counter module
Update #6003
* ALTER TABLE {counter} ADD INDEX counter_date (counter_date)
* ALTER TABLE {counter} ADD INDEX counter_ip (counter_ip)
Comment #3
murokoma commentedOh, and I just saw that the call-time.... error message persists after the update, so on ...../update.php there are still the references to the two lines 185 and 186.
as it seems that the table structure was changed, I would be happy if you could inform me how to proceed from now - is downgrading to the old version possible?
Thanks for your h elp.
Comment #4
DemonGloom commentedI got the same problem.. But now I cannot access my /admin pages.. Urls like ?q=admin/settings don't work, too. Going to rollback to previous version.
Comment #5
bfr commentedfunction counter_update_6003() {
$ret = array();
db_add_index(&$ret, 'counter', 'counter_date', array('counter_date'));
db_add_index(&$ret, 'counter', 'counter_ip', array('counter_ip'));
return $ret;
}
Like the error says, it's deprecated, passing by reference is now automatic in PHP, here's a patch that i think fixes the problem.
I think you will have to uninstall the module completely, then apply the patch and install again.
edit:
Seems to work, however, use with caution until it's confirmed good.
Comment #6
zaphod4269 commentedanyone come up with a working fix yet?
Comment #7
fabrizioprocopio commented+1
help
Comment #8
laaneoks commentedTo fix this bug, only changing these next lines is needed
sites/all/modules/counter/counter.install:185
sites/all/modules/counter/counter.install:186
- db_add_index(&$ret, 'counter', 'counter_date', array('counter_date'));
- db_add_index(&$ret, 'counter', 'counter_ip', array('counter_ip'));
+ db_add_index($ret, 'counter', 'counter_date', array('counter_date'));
+ db_add_index($ret, 'counter', 'counter_ip', array('counter_ip'));
We can do so because db_add_index() is declarated in files as
includes/database.mysql-common.inc:432
function db_add_index(&$ret, $table, $name, $fields) {
includes/database.pgsql.inc:827
function db_add_index(&$ret, $table, $name, $fields) {
Comment #9
bfr commentedWell, that's what my patch does, but atleast does not seem to work for me very well. There may be some problems with my configuration also.
Comment #10
fabrizioprocopio commentedvery kind of user posted the patch and the fix, but I'm not a coder, so I don't know how go on, or better... I'm afraid to mistake and crash my (in production) site.
How long approximately for the find the fix directly in the module???
Obviously it's NOT for claim...
:)
Comment #11
tuffnatty commentedthe patch is ok for me
Comment #12
bfr commentedWell, i guess the patch then works but my own configuration does not(which is not surprising because i have lot's of custom code messing things around).
#10
The patch just changes two lines in the module, so it should not do any damage on your site, if the counter stops working, it's very easy to reverse.
You can also do the changes manually if you dont know how to patch.
Comment #13
drupalnesia commentedI need more info to make a new release contains the solution for this issue.
Maybe this affect on certain PHP version only.
My testing machine is PHP 5.2.9 and MySQL 5.0.51a.
Comment #14
drupalnesia commented6.x-2.6: Bug fix: Call-time pass-by-reference has been deprecated patch by bfr (/user/369262)
I have tested that using $ret was safe on PHP 5.2.9, so this automatically fix newer version of PHP that has been deprecated this.
Thanks all for patch and testing!