?
avatar izharaazmi
izharaazmi
21 May 2017

Steps to reproduce the issue

Create a simple component with the given script file.
Perform Install, update, uninstall.

Expected result

On each action the script file should be able to do the processing via preflight and postflight.

Actual result

On uninstall, the preflight and postflight are not called.

System information (as much as possible)

Joomla 3.7 (I know this was same earlier)

Additional comments

Why it was decided to do it that way?

script.php.txt Remove .txt

avatar izharaazmi izharaazmi - open - 21 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 21 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 May 2017
Category JavaScript
avatar Bakual
Bakual - comment - 21 May 2017

preflight might work on uninstall, postflight gets tricky because at that point the file would already be deleted ?
However I'm not sure what you would want to do in preflight? During installation, this allows to check if we can install the package and abort if some requirements aren't met. During uninstallation I can't see why we should abort an uninstallation. That should always be possible.

avatar mbabker
mbabker - comment - 21 May 2017

postflight gets tricky because at that point the file would already be deleted

As long as the file is loaded into memory before deleted, the class and its methods will be available. So that's not an issue.

avatar Bakual
Bakual - comment - 21 May 2017

True enough :)

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 May 2017
Status New Discussion
avatar eorisis
eorisis - comment - 28 May 2017

I see at least one reason for preflight to fire on component uninstall. Currently if you install a package with say a component and 2, 3 plugins in it, you can the go on and uninstall one of them without uninstalling the whole package. But if the developer wants to "lock" this, say because they do not want extra checks in their plugins like "if the component exists" etc, they can setup preflight in such a way that it will abort the uninstall process with a warning in case you try to uninstall one of the extensions of that package. But in any case, you can never know what one may want to execute in preflight. In my tests preflight does not fire on component uninstall till J3.7.2.

avatar mbabker
mbabker - comment - 29 May 2017

#16343 is the starting point for standardizing things. It will only be 4.0 due to the required B/C breaks.

avatar brianteeman
brianteeman - comment - 29 May 2017

Closed so we just have one place see #16343

avatar brianteeman brianteeman - change - 29 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-29 17:50:52
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 May 2017

Add a Comment

Login with GitHub to post a comment