Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2012-09-18 02:59:42

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Feedback to: Textpattern CMS 4.5.1 released

I’m gradually working my way through the various adi_plugins to make them TXP 4.5 friendly and I’ve hit a snag with lifecycle events.

In the old days (i.e. pre 4.5), when a plugin was uploaded the “installed” lifecycle event would fire. Then the plugin had to be made active & the “enabled” event would kick in. This was the case whether it was a new plugin or a new version of an existing one.

Now, on TXP 4.5, it seems that if the plugin is already installed & active, then the new version doesn’t have to be made active manually.

The problem I’m now seeing is that, in this case, the “installed” event fires but not the “enabled” one – which is affecting how the plugin behaves during installation.

Is this new lifecycle behaviour intended?

Offline

#26 2012-09-18 04:04:07

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Feedback to: Textpattern CMS 4.5.1 released

It is intentional but may have consequences for your particular use case that we didn’t think of. As in previous versions “enabled” is fired when a plugin is enabled. How were you using this specific sequence of events? Would an additional “updated” event be helpful?

Offline

#27 2012-09-18 04:28:29

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Feedback to: Textpattern CMS 4.5.1 released

This is how I’ve been using the lifecycle events:

installed – do nothing
enabled – create db tables, upgrade db table structure, set prefs etc
disabled – do nothing
deleted – drop tables, delete prefs

The logic being that:

  • uploading a plugin but not making it active (“installed”) shouldn’t do anything drastic
  • making a plugin active (“enabled”) should set everything up
  • making a plugin inactive (“disabled”) should only stop it from running
  • deleting a plugin (“deleted”) should tidy everything up

Unfortunately, now that the “enabled” event is not firing during a plugin re-upload none of my upgrade functions are happening.

An “upgraded” event may be useful. But in the meantime, maybe I need to do a check during “installed” to see if the plugin has been installed previously & automatically run the “enabled” routines?

Last edited by gomedia (2012-09-18 04:29:20)

Offline

#28 2012-09-18 04:35:20

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Feedback to: Textpattern CMS 4.5.1 released

gomedia wrote:

maybe I need to do a check during “installed” to see if the plugin has been installed previously & automatically run the “enabled” routines?

Sounds reasonable. Some people use the four high bits of the ‘flags’ column in txp_plugins to track private states. Please not that the lower 12 bits are reserved for core.

Offline

#29 2012-09-23 12:15:46

linguist
Member
Registered: 2007-11-03
Posts: 24

Re: Feedback to: Textpattern CMS 4.5.1 released

Hello! My web developer upgraded my Textpattern 4.4.1 to 4.5.1 yesterday, and everything seems fine. My sincere gratitude to Textpattern developers.

I have one question. Sometimes I check “Forgot password” mechanism by typing in a random name (not any of the users’ name, and no e-mail for it in the Admin panel) and clicking “Reset password”, just to check that everything works as expected. In previous versions, Textpattern responded with “Unknown author”, and that was all.

But Textpattern 4.5.1 responded by showing this message: “A confirmation message was sent to your e-mail address. Please visit your inbox and follow the instructions.” I’m a little worried. I’d like to know if this is expected behavior. Is there any chance that Textpattern did send a message somewhere? (No message in any of my users’ e-mail boxes.) Or is it just some kind of general message for error cases with “Forgot password”? Thank you.

Offline

#30 2012-09-23 13:23:32

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Feedback to: Textpattern CMS 4.5.1 released

linguist wrote:

But Textpattern 4.5.1 responded by showing this message: “A confirmation message was sent to your e-mail address. Please visit your inbox and follow the instructions.” I’m a little worried. I’d like to know if this is expected behavior. Is there any chance that Textpattern did send a message somewhere? (No message in any of my users’ e-mail boxes.) Or is it just some kind of general message for error cases with “Forgot password”? Thank you.

Everything works as expected, and no email is actually sent. Displaying the same success message is a security related feature and an improvement from 4.4.1.

Any public facing log-in or password recovery form should really never reveal whether a user account exists or not. Otherwise the form can be used to fish out and verify existing, real user accounts. This was what the reset form prior to 4.5.0 allowed to do.

Last edited by Gocom (2012-09-23 13:25:48)

Offline

#31 2012-09-23 13:36:03

linguist
Member
Registered: 2007-11-03
Posts: 24

Re: Feedback to: Textpattern CMS 4.5.1 released

Thank you for your answer, Gocom. Really appreciate it.

Offline

#32 2012-10-04 15:24:10

feragnoli
Member
From: the hague
Registered: 2005-02-10
Posts: 150

Re: Feedback to: Textpattern CMS 4.5.1 released

Is there any thread reporting on plugin functionalities under txp 4.5.1?
thanks


what was that again…?

Offline

#33 2012-10-04 16:07:39

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Feedback to: Textpattern CMS 4.5.1 released

@feragnoli

There was a list for 4.5 beta but I’d imagine a few of those plugins have been updated to work with 4.5 (and 4.5.1)

Offline

Board footer

Powered by FluxBB