Page 2 of 2

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

Posted: Tue Jul 23, 2013 7:11 pm
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

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

Posted: Wed Jul 24, 2013 12:03 pm
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 ??

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

Posted: Wed Jul 24, 2013 2:06 pm
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

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

Posted: Tue Jul 30, 2013 11:31 am
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...

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

Posted: Tue Jul 30, 2013 1:07 pm
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)

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

Posted: Tue Jul 30, 2013 2:14 pm
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! :)

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

Posted: Tue Jul 30, 2013 2:54 pm
by garvinhicking
I don't half of this but since I'm happy. ;)

Regards,
Garvin