Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-10-06 04:47:02

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

etc wrote #314308:

No guarantee that it works, but a negative result is still a result.

Sorry about the delay, I did try but it didn’t work

The steps I took were to 1) replace my database with the backup, 2) disable all of the plugins through changing the status in the txp_plugin table to 0, 3) replaced the code in _to_4.6.0.pdf with the code you provided, and 4) login to the admin panel.

It reported:

User_Error "Incorrect datetime value: '0000-00-00 00:00:00' for column 'Expires' at row 1"
in /home/picklit/web/pickl-it.com/public_html/textpattern/lib/txplib_db.php at line 410.

textpattern/lib/txplib_misc.php:1715 adminErrorHandler()
updateErrorHandler()
textpattern/lib/txplib_db.php:410 trigger_error()
textpattern/lib/txplib_db.php:545 safe_query()
textpattern/update/_to_4.6.0.php:29 safe_alter()
textpattern/update/_update.php:91 include()
textpattern/index.php:214 include()

User_Error "Unknown column 'owner' in 'field list'"
in /home/picklit/web/pickl-it.com/public_html/textpattern/lib/txplib_db.php at line 410.

textpattern/lib/txplib_misc.php:1715 adminErrorHandler()
updateErrorHandler()
textpattern/lib/txplib_db.php:410 trigger_error()
textpattern/vendors/Textpattern/L10n/Lang.php:494 safe_query()
textpattern/vendors/Textpattern/L10n/Lang.php:414 Textpattern\L10n\Lang->upsertPack()
textpattern/update/_update.php:121 Textpattern\L10n\Lang->installFile()
textpattern/index.php:214 include()

Fatal error: Uncaught Exception: update failed in /home/picklit/web/pickl-it.com/public_html/textpattern/lib/txplib_misc.php:1719 Stack trace: #0 [internal function]: updateErrorHandler(256, 'Unknown column ...', '/home/picklit/w...', 410, Array) #1 /home/picklit/web/pickl-it.com/public_html/textpattern/lib/txplib_db.php(410): trigger_error('Unknown column ...', 256) #2 /home/picklit/web/pickl-it.com/public_html/textpattern/vendors/Textpattern/L10n/Lang.php(494): safe_query('INSERT INTO txp...') #3 /home/picklit/web/pickl-it.com/public_html/textpattern/vendors/Textpattern/L10n/Lang.php(414): Textpattern\L10n\Lang->upsertPack(Array) #4 /home/picklit/web/pickl-it.com/public_html/textpattern/update/_update.php(121): Textpattern\L10n\Lang->installFile('en-us') #5 /home/picklit/web/pickl-it.com/public_html/textpattern/index.php(214): include('/home/picklit/w...') #6 {main} thrown in /home/picklit/web/pickl-it.com/public_html/textpattern/lib/txplib_misc.php on line 1719

p.

Offline

#12 2018-10-06 08:56:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,589
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Thanks for trying. This is somewhat baffling but it probably has to do with the fact that your MySQL is set to strict mode or something. According to this post altering the default value for a table doesn’t change any existing values in the table (as expected) but if you do that in strict mode, MySQL checks the contents before performing the alteration and in this case borks.

The solutions proposed are all logical and maybe something we could try. Since we’ve found the ‘change all values in the table’ route doesn’t work (although, interestingly, the post above the one I linked in the StackOverflow thread intimated that you could get around it by using a WHERE CAST(Expires AS CHAR(20)) = '0000-00-00 00:00:00' construct) I wonder if we could temporarily turn off strict mode prior to doing the changes then reinstate it afterwards?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#13 2018-10-06 10:59:44

etc
Developer
Registered: 2010-11-11
Posts: 3,086
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Yep, not any better. WHERE NOT YEAR(`Expires`) worked for me, but disabling strict mode would probably be easier, if no special rights are required for this.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#14 2018-10-06 11:58:47

etc
Developer
Registered: 2010-11-11
Posts: 3,086
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Also, IGNORE seems to work for me, e.g.

UPDATE IGNORE `textpattern` SET ...

etc_[ query | search | pagination | date | tree | cache ]

Offline

#15 2018-10-06 16:54:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,589
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Hmmm. IGNORE would work but might cause issues later since it’d, well, ignore the problem!

I vote we try to disengage strict mode around this chunk of code and see if things improve for mericson. Can’t hurt, right? (Famous last words)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2018-10-06 17:06:36

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Bloke wrote #314441:

Thanks for trying. This is somewhat baffling but it probably has to do with the fact that your MySQL is set to strict mode or something.

I checked the MySQL environment and I’m running MySQL 5.7.23. You are correct that the issue is related to strict mode, but more specifically strict mode along with NO_ZERO_DATE.

The ‘SQL mode’ on my server is ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION.

Most importantly, that is the default SQL mode upon release of MySQL 5.7 on October 21, 2015.

Last edited by mericson (2018-10-06 18:56:49)

Offline

#17 2018-10-06 19:07:27

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

I tested removing just the NO_ZERO_IN_DATE from my ‘SQL mode’ and the upgrade was successful.

I guess MySQL is suggesting using a zero date is a bad practice since they restricted it by default in MySQL 5.7.

Offline

#18 2018-10-06 22:02:43

etc
Developer
Registered: 2010-11-11
Posts: 3,086
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

Bloke wrote #314447:

Hmmm. IGNORE would work but might cause issues later since it’d, well, ignore the problem!

I mean we would use it just on update, not any later.

I vote we try to disengage strict mode around this chunk of code and see if things improve for mericson. Can’t hurt, right? (Famous last words)

Sure, if no special rights are required to disable/enable it, let’s try.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#19 2018-10-08 19:57:21

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

mericson wrote #314452:

I tested removing just the NO_ZERO_IN_DATE from my ‘SQL mode’ and the upgrade was successful.

I mistyped, it was disabling NO_ZERO_DATE that allowed the upgrade to complete succesfully. And I didn’t have to turn off ‘strict mode’ in its entirety, just NO_ZERO_DATE.

etc wrote #314456:

I mean we would use it just on update, not any later.

Sure, if no special rights are required to disable/enable it, let’s try.

When you say you wouldn’t use it any later, does that mean the ‘zero dates’ are only temporary during upate? They aren’t in the database anymore after?

I personally would recommend looking for an option that doesn’t require a ‘zero date’ what about NULL or what about the beginning of the epoch + 1 second? Then you don’t have to disable the checking, and you avoid any future pitfalls of using a ‘zero date.’

Offline

#20 2018-10-08 20:03:45

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

I will add, the larger issue I have with my site upgrade is now plugin compatibility with PHP 7.2. Many of the extensions I use don’t appear to be compatible, and they are mostly no longer under maintenance/development. Stef, I’m even getting complaints from PHP about smd_if! Apparently its use of a function as the same name as the class as a constructor has been deprecated.

Offline

Board footer

Powered by FluxBB