Loading...
 
Skip to main content

Update problems

Status
Closed
Subject
Update problems
Version
1.9.x
4.x
Category
  • Error
Feature
Installer (profiles, upgrades and server-related issues)
Resolution status
Out of Date
Submitted by
dclaar
Lastmod by
drsassafras
Rating
(0)
Description

I'm sure that nobody is really trying this, but the doc claims that an upgrade from 1.9 to 4.1 should work. When running the DB upgrade, I've hit four errors:
PHP Fatal error: Call to a member function fetchRow() on a non-object
in /var/www/tiki/installer/schema/20090923_mod_change_category_defaults_tiki.php on line 11, referer: http://dc-dev/spwiki/tiki-install.phpQuestion

PHP Fatal error: Call to a member function fetchRow() on a non-object
in /var/www/tiki/installer/schema/20091004_last_tracker_items_modules_merge_tiki.php on line 11, referer: http://dc-dev/spwiki/tiki-install.phpQuestion

PHP Fatal error: Call to a member function fetchRow() on a non-object
in /var/www/tiki/installer/schema/20091019_article_by_rating_modules_merge_tiki.php on line 11, referer: http://dc-dev/spwiki/tiki-install.phpQuestion

Call to a member function fetchRow() on a non-object
in /var/www/tiki/installer/schema/20091019_last_articles_modules_merge_tiki.php on line 11, referer: http://dc-dev/spwiki/tikiQuestion
-install.php


Oops, didn't have alter privs on DB. Not sure if that's why this failed.

Solution

The solution (or at least workaround) is to check if the query returned anything. I have no idea if these functions should return any rows, but they're not with my DB. Here's a hacky fix for the first one. I tried while ($result && $result->fetchRow()), but I guess php doesn't do partial eval?? (I'm more of a perl guy...)

patch for first problem
Copy to clipboard
*** /var/www/tiki/installer/schema/20090923_mod_change_category_defaults_tiki.php.orig 2010-01-13 18:33:36.000000000 -0800 --- /var/www/tiki/installer/schema/20090923_mod_change_category_defaults_tiki.php 2010-01-13 18:35:09.000000000 -0800 *************** *** 8,19 **** function upgrade_20090923_mod_change_category_defaults_tiki( $installer ) { $result = $installer->query( "select moduleId, params from tiki_modules where name='change_category'; " ); ! while( $row = $result->fetchRow() ) { ! $params = $row['params']; ! if (strpos($params, "multiple=") === false) { ! if ($params) $params .= "&"; ! $params .= "multiple=n"; ! $installer->query( "update tiki_modules set params='" . $params . "' where moduleId=" . $row['moduleId'] . "; " ); } } } --- 8,21 ---- function upgrade_20090923_mod_change_category_defaults_tiki( $installer ) { $result = $installer->query( "select moduleId, params from tiki_modules where name='change_category'; " ); ! if ($result) { ! while($row = $result->fetchRow() ) { ! $params = $row['params']; ! if (strpos($params, "multiple=") === false) { ! if ($params) $params .= "&"; ! $params .= "multiple=n"; ! $installer->query( "update tiki_modules set params='" . $params . "' where moduleId=" . $row['moduleId'] . "; " ); ! } } } }
Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2986
Created
Thursday 14 January, 2010 18:18:41 UTC
by dclaar
LastModif
Thursday 17 November, 2016 03:37:45 UTC


Show PHP error messages