Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

etc
Developer
Registered: 2010-11-11
Posts: 5,156
Website GitHub

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.

Online

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

etc
Developer
Registered: 2010-11-11
Posts: 5,156
Website GitHub

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

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

UPDATE IGNORE `textpattern` SET ...

Online

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

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: 5,156
Website GitHub

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.

Online

#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

#21 2018-10-08 20:18:44

etc
Developer
Registered: 2010-11-11
Posts: 5,156
Website GitHub

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

mericson wrote #314478:

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?

Zero dates were default in 4.5.7, the upgrade script tries to replace them with NULL. The problem is that in NO_ZERO_DATE mode every mention of zero dates, even to update them, yields an error. So the update query fails, unless we do it in IGNORE mode. In this case, once the update is done, there will be no more zero dates in the db. Since this script runs only on 4.5 -> 4.6+ update, eventual further errors will not be ignored.

Online

#22 2018-10-09 04:54:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,080
Website GitHub Mastodon Twitter

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

mericson wrote #314479:

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.

Many of those plugins are possibly no longer needed. If you post the incompatible plugins and how you use them, there will most probably be a native tag to replace the code.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#23 2018-10-09 05:26:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,718
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

mericson wrote #314479:

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.

Yes, colak’s right. If you let us know which ones (the diagnosis tab provides a nice list of plugins and versions) we can see if there are workarounds, replacements or updates. A lot just need registering with the tag registry (i.e. they are permitted txp:tag names) – smd_if is one of them. That ‘function as the same name as the class as a constructor has been deprecated’ is common in association with php 7 and older code but also often straightforward to remedy (see the smd_xml thread for an example), though I can’t immediately see why smd_if should be the culprit there.

Best to post that all in a new thread.


TXP Builders – finely-crafted code, design and txp

Offline

#24 2018-11-14 20:57:52

morgant
Plugin Author
From: Vermont, United States
Registered: 2004-06-22
Posts: 63
Website

Re: Textpattern 4.5.7 -> 4.7.1 upgrade failed

The temporary disabling of NO_ZERO_DATE in _to_4.6.0.php which is in the upcoming Textpattern v.4.7.2 worked for me! I was upgrading from 4.5.4, so I also had to apply the same patch to _to_4.5.7.php.

Offline

Board footer

Powered by FluxBB