Notifications
Clear all

5 errors in upgrade20.php with solutions

2 Posts
2 Users
0 Reactions
2,460 Views
(@jrabbit)
Posts: 64
Trusted Member
Topic starter
 

Apologies to moderators - didn't notice the upgrades subforum - this belongs in there - please move.

On first attempt to upgrade I get an message from the CREATE TABLE statement for the fanfiction_settings table that it already exists.

I dropped the table and refreshed the post. This time it fell over inserting into the new fanfiction_settings table. I noticed an ' in the slogan was already escaped in the config file and it was double escaped when put into this query as \'. However, the reason it fell over was that the minwords and maxwords values were missing in the values clause of the insert statement it ran:


INSERT INTO sofanfiction_settings(
`sitekey`, `sitename`, `slogan`, `url`, `siteemail`, `tableprefix`, `skin`, `language`,
`submissionsoff`, `storiespath`, `store`, `autovalidate`, `maxwords`, `minwords`,
`imageupload`, `imageheight`, `imagewidth`, `roundrobins`, `tinyMCE`, `allowed_tags`,
`favorites`, `multiplecats`, `newscomments`, `recentdays`, `displaycolumns`,
`itemsperpage`, `displayindex`, `defaultsort`, `reviewsallowed`, `ratings`,
`anonreviews`, `revdelete`, `rateonly`, `pwdsetting`, `alertson`, `disablepopups`,
`agestatement`, `words`, `smtp_host`, `smtp_username`, `smtp_password`) VALUES(
'removed for privacy', 'removed for privacy', 'removed for privacy', 'removed for privacy', 'removed for privacy',
'so', '3column', 'en', 1, 'stories', 'files', 0,
, , 0, 400,
400, 0, 0, '<strong><em><br /><br><blockquote><strike><font><b><i><u><center><img><a><hr><p><ul><li><ol>',
1, 1, 1, 7, 4,
20, 0 , 0,
1, 1,
0, 0, 0,
1, 1, 0,
0, '', '',
'', '')

I fixed this by changing line 899 of upgrade20.php to:


".($maxwords>0 ? $maxwords : 0).", ".($minwords>0 ? $minwords : 0).", $imageupload, ".($imageheight ? $imageheight : 0).",

Things then went will until step 10 when the following error occured:


Query: ALTER TABLE sofanfiction_stories ADD `storynotes` TEXT NULL DEFAULT '' AFTER `summary`;
Error: (1101) BLOB/TEXT column 'storynotes' can't have a default value

This is a change in recent versions of mysql (I am runing 5.0.27) - defaults for text columns used to be allowed in create table statements
and ignored by the implementation in older versions. The fix was to edit lines 440 & 441 of upgrade20.php to take out the defaults


$result = dbquery("ALTER TABLE ".$tableprefix."fanfiction_stories ADD `storynotes` TEXT NULL AFTER `summary`;");
$result = dbquery("ALTER TABLE ".$tableprefix."fanfiction_chapters ADD `endnotes` TEXT NULL AFTER `storytext`;");

It then went will until step 18 when the following error occurred:


Fatal error: Call to undefined function seriesreview() in F:httpdocsinstallupgrade20.php on line 168

The solution to this was to paste the three functions storiesInSeries,  subseriesList and  seriesreview into upgrade20.php at line 50.

My upgrade then completed successfully.


 
Posted : 11/12/2006 8:19 pm
(@tammy)
Posts: 2577
Member Moderator
 

Thank you.


 
Posted : 11/12/2006 8:36 pm
Share: