2 jfeise Jul 24, 2012 21:45

This diff fixes the problem:
--- b2evolution-4.1.4.orig/blogs/install/_functions_evoupgrade.php 2012-04-03 11:17:56.000000000 -0700
+++ b2evolution-4.1.5/blogs/install/_functions_evoupgrade.php 2012-07-24 12:58:37.463559112 -0700
@@ -242,6 +242,9 @@
global $locales, $default_locale;
global $DB;
global $admin_url;
+ global $servertimenow;
+
+ $servertimenow = time();
// used for defaults, when upgrading to 1.6
global $use_fileupload, $fileupload_allowedtypes, $fileupload_maxk, $doubleCheckReferers;
@@ -3144,4 +3147,4 @@
/*
* $Log: _functions_evoupgrade.php,v $
*/
Yep, a nasty error that was fixed in trunk but somehow squeezed into "stable" branch :)
Here's the function from trunk.
function invalidate_pagecaches()
{
global $DB, $Settings, $servertimenow;
// get current server time
$timestamp = ( empty( $servertimenow ) ? time() : $servertimenow );
// get all blog ids
if( $blog_ids = $DB->get_col( 'SELECT blog_ID FROM T_blogs' ) )
{ // build invalidate query
$query = 'REPLACE INTO T_coll_settings ( cset_coll_ID, cset_name, cset_value ) VALUES';
foreach( $blog_ids as $blog_id )
{
$query .= ' ('.$blog_id.', "last_invalidation_timestamp", '.$timestamp.' ),';
}
$query = substr( $query, 0, strlen( $query ) - 1 );
$DB->query( $query, 'Invalidate blogs\'s page caches' );
}
// Invalidate general cache content also
$Settings->set( 'last_invalidation_timestamp', $timestamp );
$Settings->dbupdate();
}
I just upgraded and had the same issue.
...so after the error everything seems to be running properly. Do I need to do something?
v4.1.5b fixes that error
...so after the error everything seems to be running properly. Do I need to do something?
Yes, the only problem was in the function mentioned above/
I'm not clear on what exactly I need to do - sorry. I already deleted the install folder as everything seemed to be working - I can re-upload it if needed, but my installation shows the new version 4.1.5 running and I'm not experiencing any errors.
Can you please advise.
...nevermind - I saw and ran the update - everything went through fine. Thnx
Hello,
Updated from 4.12 to 4.15b and get the same error. So what to do? Ignore or change code?
thx for yer time
micha
Are you talking about this error?
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 '), (4, "last_invalidation_timestamp", ), (5, "last_invalidation_timestamp", ),' at line 1(Errno=1064)
Your query: Invalidate blogs's page caches
REPLACE INTO evo_coll_settings ( cset_coll_ID, cset_name, cset_value )
You should [u]only[/u] see it during install/upgrade.
Looking in the code, in function invalidate_pagecaches() in file inc/_core/_misc.func.php, it seems that $servertimenow is not set in the upgrade case.
In 4.1.4, the function used a local variable that was set to the output of time(), as a diff shows.