[2.0] New event hooks for plugin installation/update

Discussion corner for Developers of Serendipity.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] New event hooks for plugin installation/update

Post by Timbalu »

OK, Garvin.
It was a bit tricky to trigger or fake a spartacus download, but I tried with

Code: Select all

?serendipity[adminModule]=plugins&serendipity[pluginPath]=serendipity_event_ckeditor&serendipity[install_plugin]=serendipity_event_ckeditor
at last and that one properly fell back to the plugins config, deflating the zip.

Since it was to hot here, I sadly did not remember all the work I had done over day in the other files outside the zip, which got overwritten by the previous version with my first update try having appended &serendipity[spartacus_fetch]=event&serendipity[spartacus_upgrade]=true. I have to start from scratch... :( But anyway: The reason for testing was the new hook and that is working!

So I would say, your commit brought in a very good feature for us all!! :D
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] New event hooks for plugin installation/update

Post by Timbalu »

The only issue I had, was, that it created serveral new instances of that plugin (like when you reload the installer page, because of something went wrong...). But I think this happend because I faked Spartacus Update behaviour like mentioned above; Not an issue of the hooks, I presume.

Without knowing this in detail at now, couldn't we disable/mitigate this reload issue behaviour in general by adding at least an if stackable check to the plugin installer ??
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] New event hooks for plugin installation/update

Post by garvinhicking »

Hi!
Without knowing this in detail at now, couldn't we disable/mitigate this relead issue behaviour in general by adding at least an if stackable check to the plugin installer ??
Yes, that would be a good idea. Not sure if that stackable attribute is easy fetchable at that point.

(Definitely something for 2.0, not 1.7)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] New event hooks for plugin installation/update

Post by Timbalu »

Garvin, I do think we need to finetune that a tad more..., since I just had this (at least I assume this was the reason), that the autoupdate Plugin update via Spartacus this morning somehow triggert the 'backend_plugins_update' hook of my new dev 1.3 ckeditor again. Could that be? My editor (where all files are always open) suddenly (on focus) stated all files in ckeditor to have changed, indicating, that we might need some strict questionaire, eg. ~"if this single plugin install == $serendipity['GET']['install_plugin']" or so before that hook gets executed...
I'll need to see this happen next time a plugin update occurs via Spartacus... to be sure this is the reason and not an unfinished dev plugin setup on my side...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] New event hooks for plugin installation/update

Post by garvinhicking »

Don't know, sorry. The hook should be executed whenever the plugin is installed (if you have multiple instances of a plugin, each plugin will execute the hook)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] New event hooks for plugin installation/update

Post by Timbalu »

I don't have multiple instances and stackable is set false...
The deflating was triggered and all deflated files have todays date now. This "triggered hook" did not execute the fallback to config, which was the main reason for that hook, but when opening the config afterwards, it stated to me being updated and deflated.
So it must have been somehow triggered by that other plugins update via spartacus. That is why I thought this hook was executed for that other plugins update too.

But I finally figured it out, running that autoupdate plugin some times more...
I really was my dev setup not been deflated again, since I changed my files ... after having tried the hook work correctly days ago.

In these new multiple tries with the autoupdate plugin update, the ckeditor config (manualy opened) always stated being updated, without the need of deflating. This happend due to my internal checks and my need/wish to note that to the user... I now simply changed that checks message, so it can mean, everything ok, or an update without deflating needs has run successfully. This is only triggered on real self updates or, if another plugin was updated. Fine! :)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] New event hooks for plugin installation/update

Post by garvinhicking »

I don't half of this but since I'm happy. ;)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply