Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2017-12-07 12:20:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,800
Website

Re: Error when installing a plugin, last 4.7 dev

etc wrote #308152:

Please test if this workflow solves the problem. Thanks!

Untested, but I suspect that will break people’s sites spectacularly ;-)


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

#12 2017-12-07 12:26:49

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 641
Website

Re: Error when installing a plugin, last 4.7 dev

Bloke wrote #308154:

Untested, but I suspect that will break people’s sites spectacularly ;-)

I just uploaded the latest version. I totally emptied the cache of FFox, I reloaded every problem page with cmd-r
I had at the start the indication of a new version and sending to diagnostics.

My problems are still there: plugin upload: non active textarea and idem file upload zone.

BTW, site not breaken …

Offline

#13 2017-12-07 12:32:01

etc
Developer
Registered: 2010-11-11
Posts: 2,351
Website

Re: Error when installing a plugin, last 4.7 dev

Hmm, yes, 1 is a valid point, didn’t thought of it. As for 2, I meant update directory check, not remote.

What stops me from auto-config is the possibility that someone runs setup before you do.


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

Offline

#14 2017-12-07 12:32:23

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,179
Website

Re: Error when installing a plugin, last 4.7 dev

jpdupont wrote #308155:

plugin upload: non active textarea and idem file upload zone.

See my latest post in the theme thread.

Offline

#15 2017-12-07 12:36:28

etc
Developer
Registered: 2010-11-11
Posts: 2,351
Website

Re: Error when installing a plugin, last 4.7 dev

Bloke wrote #308154:

Untested, but I suspect that will break people’s sites spectacularly ;-)

Too late :-) But why would it?


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

Offline

#16 2017-12-07 12:41:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,800
Website

Re: Error when installing a plugin, last 4.7 dev

jpdupont wrote #308155:

I had at the start the indication of a new version and sending to diagnostics.

So the upgrade script ran. Good…

My problems are still there: plugin upload: non active textarea and idem file upload zone.

… but perhaps not fully.

BTW, site not breaken …

Because your previous failed upgrade attempts may have left the database in a “half-updated” state.

During upgrade, we test certain things and make (probably foolish) assumptions. For example:

  1. Does the textpack column exist in the database?
  2. Yes, great!
  3. No, add textpack and data columns, then modify the help column size.

See the problem there? It’s subtle. If during a previous upgrade run, the textpack column was added but the data and help changes weren’t (for some reason) then you’ll get errors or weird behaviour because the filesystem expects the database to contain those table changes.

If you re-run upgrade to ‘fix’ the problems, it looks for the textpack column, finds it, says to itself, “Great, that’s all been done” and carries on. Crucially, it bypasses the addition of the extra columns because they were tied to the check for the textpack column.

The safer – slower – way we should be doing upgrades is:

  1. Does the textpack column exist in the database?
  2. Yes, great!
  3. No, add textpack column.
  4. Does the data column exist in the database?
  5. Yes, great!
  6. No, add data column
  7. Is the help column size what we expect?
  8. Yes, great!
  9. No, modify the help column size.

That way, we can guarantee that all changes are done even if a partial upgrade occurred. Historically, we haven’t done that, and the tradition continues in 4.7.0. Maybe we should adopt that methodology to help avoid situations like this?


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

#17 2017-12-07 12:53:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,800
Website

Re: Error when installing a plugin, last 4.7 dev

etc wrote #308159:

Too late :-) But why would it?

Without testing I’m not positive it wouldn’t work. If it does, great. But imagine this:

  1. You upload files for new version.
  2. You – or some other user – log in and your default panel is the Languages panel (you like that page, okay?!)
  3. You land on that panel. There’s a message in the footer but you don’t see that. And even if you did: “New version available? So what, I’ll do that later.”
  4. Your page is a bit haywire. The file system has asked to fetch available languages, which it does, but they have old key names.
  5. You notice it says all your languages are out of date.
  6. You click one to update it. Boom! It can’t find that file because the key it looks for (based on the lang column in the DB) is the 4.6.2 reference. The database upgrade hasn’t taken place which refactors all keys in the table. That will continue to be the case until you complete the upgrade process by visiting Diagnostics.

Potentially the same issue on any other page. The filesystem might expect columns to be there that aren’t. Or that have been renamed, resized, reindexed…

Bottom line: in our current system, after any filesystem update that changes the version, the corresponding DB updates MUST run immediately.


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

#18 2017-12-07 13:05:38

etc
Developer
Registered: 2010-11-11
Posts: 2,351
Website

Re: Error when installing a plugin, last 4.7 dev

What have I done! crazy… Well, what is the point of sending to Diagnostics pane? Let’s update, cleanup, post a message and leave the hand to events?


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

Offline

#19 2017-12-07 14:13:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,800
Website

Re: Error when installing a plugin, last 4.7 dev

etc wrote #308162:

Well, what is the point of sending to Diagnostics pane?

Traditionally we’ve landed on Languages. I’m intending to auto-update those during upgrade so we no longer need to land there as it’ll indicate they’re all up-to-date. A better place to indicate that an upgrade has taken place is Diagnostics, because any snafus that have occurred during the process can be shown there as part of the regular diagnostic checks.

Plus, it shows a “Welcome to Txp X.Y.Z” message there now. In theory…

In future, I was planning on introducing a ‘flash message’ – one time persistent message store. Like an array. Any actions that take place get added to that, one per row, with their severity marked. Then, on next page refresh the entire array is output and the Flash array is wiped.

We could use this during upgrade. Each action that’s done, add it to the flash message store and then – when everything’s done, dump it out beneath the ‘welcome’ message under a twisty so you can see the detailed results of what’s been done.

Longer term, there’s no reason we couldn’t do that for the regular messages too on every panel. Instead of relying on returning a single $msg string from actions, any exceptions or success messages get added to the Flash Message array. Plugins casn use it too. Then on page load, the message appears at the bottom of the screen and the Flash message array is wiped (just in case).

The beauty here is that the message area doesn’t have to be confined to one colour. It might have 2 actions that succeeded, one that failed. We could show three line items, green, green, red. Better traceability.

I have the class written – at least most of it – but haven’t got round to finishing it. Anyone who wants it, just holler and I’ll send it over.

Last edited by Bloke (2017-12-07 14:13:43)


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

#20 2017-12-07 14:26:28

etc
Developer
Registered: 2010-11-11
Posts: 2,351
Website

Re: Error when installing a plugin, last 4.7 dev

Then welcome to the future — the messages are merging now (had to do it for multiple files upload). The upgrade script (and anyone else) can add as many messages as it needs. The system is very basic and we’ll certainly push it further in some future future. :-)

Why redirecting is bad: imagine you have spent hours on huge file uploading, close to 100% and paf! — someone has uploaded new version meanwhile but not yet run the update script. I’m for making updates less intrusive.


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

Offline

Board footer

Powered by FluxBB