SimplePortal

Support => Install and Upgrade => Topic started by: tclong on November 27, 2010, 05:37:59 PM

Title: Invalid Default value for 'approved'
Post by: tclong on November 27, 2010, 05:37:59 PM
How do I fix this.  I updated to SMF 2.0 RC4 tried to reinstall 2.3.2 and then tried 2.3.3  I did not uninstall 2.3.2 before upgrading to SMF 2.0 RC4.  Please let me know what I need to adjust to get this reinstalled. -- Thanks for your time.

Database Error Invalid default value for 'approved'
File: D:\hshome\timlong\myspacecoast.com\forums\Packages\temp\install2.php
Line: 501
Title: Re: Invalid Default value for 'approved'
Post by: AngelinaBelle on November 29, 2010, 12:35:49 PM
This is a very odd error. line 501 of install2.php is adding columns to the simpleportal tables, as needed.
Code: (install2.php, SimplePortal 2.3.3) [Select]
   if (!isset($column['deprecated_name']) || !$smcFunc['db_change_column']($smf_db_prefix . $table, $column['deprecated_name'], $column))
    $smcFunc['db_add_column']($smf_db_prefix . $table, $column); //line 501

When the error occurs, it appears that it is trying to add, if necessary, column 'approved' to the sp_articles table. In this install2, no default value is given for the field, so the SMF function used (smf_db_add_column, found in DbPackages-mysql.php), should find that the column already exists on the database and wind up trying to update it.  I think the SQL query ought to turn out like:
Quote
ALTER TABLE smf2test_sp_articles CHANGE COLUMN `approved` `approved` tinyint(2) NOT NULL default '0' 

MySQL converts '0' to 0, and everybody is happy.
 
That's what is supposed to happen.
 
It would seem that something else is actually happening.
 
To figure out what is wrong, we probably need to know the actual SQL query. Would you be able to make the necessary changes to the correct files and report the actual SQL query?
Title: Re: Invalid Default value for 'approved'
Post by: tclong on November 29, 2010, 04:36:51 PM
Thanks for your time in this.  Tell me where to find and what to change and I will be happy to give it a try.

Tim
Title: Re: Invalid Default value for 'approved'
Post by: AngelinaBelle on November 30, 2010, 08:07:05 PM
This may get a little complicated.
 
What version of SimplePortal did you have installed before you did the upgrade?
 
 
Title: Re: Invalid Default value for 'approved'
Post by: tclong on November 30, 2010, 09:19:45 PM
2.3.2
Title: Re: Invalid Default value for 'approved'
Post by: AngelinaBelle on November 30, 2010, 11:51:51 PM
OK.  For going from 2.3.2 to 2.3.3, install2.php should not actually be necessary.
I had thought about how to find and solve the install2.php problem, but I think, in this case, it would be more pragmatic to ignore the problem. Much easier.
 
One user described the process very well at:
Easiest solution to that issue is to open up SimplePortal_2.3.2.zip and remove these lines of code from package-info.xml:

Code: [Select]
      <!-- Install scripts -->
      <database>install2.php</database>

To do that either extract the files to your computer, edit that one and recreate the archive, or edit it directly from 7zip (right-click -> Edit, make the changes and hit CTRL+S, then click yes when prompted to update the archive)
Title: Re: Invalid Default value for 'approved'
Post by: tclong on December 01, 2010, 06:30:38 PM
Thanks --  That installed 2.3.2 and then had the same error when I tried to upgrade to 2.3.3.  I did the same thing to 2.3.3 and it installed.  I guess I will have to do that each time I upgrade from now on. 
Keep this thread so I can find it when I upgrade next hehehehe.  Thanks again for all your help.  I appreciate it.
Title: Re: Invalid Default value for 'approved'
Post by: AngelinaBelle on December 01, 2010, 11:46:59 PM
Your problem should not be happening, so the workaround should not be necessary.
 
One of these days, the problem will get solved, and the workaround will no longer be necessary.
Thanks for providing information that might contribute to the solution.
 
You should be able to find the topic (and an earlier one) again by searching on invalid approved.
 
 
Title: Re: Invalid Default value for 'approved'
Post by: ccbtimewiz on December 02, 2010, 02:41:41 AM
A question-- what database storage medium are you using? MySQL? SQLite? postgreSQL?
Title: Re: Invalid Default value for 'approved'
Post by: tclong on December 02, 2010, 09:48:49 PM
MySQL
Title: Re: Invalid Default value for 'approved'
Post by: majoga on December 12, 2010, 06:04:06 PM
Hi Guys,

I have the exact same problem upgrading from 2.3.1 to 2.3.3. Will the workaround above work for this too? Or do I need to install 2.3.2 first?

Using SMF 2.0 RC4

Thanks,
Majoga
Title: Re: Invalid Default value for 'approved'
Post by: tk2012 on December 18, 2010, 02:55:21 PM
Thanks, the fix worked for me as well.
SimplePortal 2.3.8 © 2008-2024, SimplePortal