SMF Development > Fixed or Bogus Bugs

[Ticket] Modules Uninstall Conflicts

(1/3) > >>

tmarques:
There's an issue with uninstalling mods that I'd like very much to see solved and to which I can lend a hand if kindly mentored to the right direction. It goes something like this:

Modules frequently overlap with other modules in the files they modify. So one applies a fix to this code:

array = (
   'var1' => 'var1p',
   'var2' => 'var2p',
   'var3' => 'var3p',
)

That looks like this:

array =(
   'var1' => 'var1p',
   'var2' => 'var2p',
   'varOLD => 'varOLDp',
   'var3' => 'var3p',
)

Then we install another mod that modifies the same section and it ends up like this:

array =(
   'var1' => 'var1p',
   'var2' => 'var2p',
   'varOLD => 'varOLDp',
   'varNEW => 'varNEWp',
   'var3' => 'var3p',
)

So the first mod will try and search for:

array =(
   'var1' => 'var1p',
   'var2' => 'var2p',
   'varOLD => 'varOLDp',
   'var3' => 'var3p',
)

To replace with:

array = (
   'var1' => 'var1p',
   'var2' => 'var2p',
   'var3' => 'var3p',
)

And won't find it. This is a problem when managing big forums with mods counting in the dozens, when there is a need to fix some module that has been installed first than say 20 other ones.
The way I do it is keep an order of the installed mods and uninstall all that were installed after module X, before uninstalling X. This sometimes means uninstalling many mods, which takes time and is prone to error.

I would like very much to see this solved in a way that if I want to uninstall module X and modules: Y1, Y2, Y3, Y4 and Y5 were installed after, SMF should uninstall all Yx modules, then the X module, then install all Yx modules again.
This would require that a list is shown before hand, since while installing and uninstalling topics one might run into problems with deleted helper files, like with Global Headers and Footers, but it allows to embedded the changes into a custom modification of said module so that it can always automatized afterwards.

Are you planning such fix, are my modules coded wrong? I'm willing to implement a solution myself and share it with you if you would be kind enough to help me on this.

Best regards,
Tiago

Kindred:
Questions like this should not be posted to the helpdesk (since Devs only rarely read the helpdesk)

We have the bug reports board and SMF coding boards which are better arenas to air these sort of items.


So, as such, I am dropping this out of helpdesk and into the forum

Norv:
Another thread of interest on the same problem:
http://www.simplemachines.org/community/index.php?topic=381354.msg2631155#msg2631155

Thank you for the report.

About:

--- Quote from: tmarques on December 03, 2010, 02:38:09 PM ---I would like very much to see this solved in a way that if I want to uninstall module X and modules: Y1, Y2, Y3, Y4 and Y5 were installed after, SMF should uninstall all Yx modules, then the X module, then install all Yx modules again.
This would require that a list is shown before hand, since while installing and uninstalling topics one might run into problems with deleted helper files, like with Global Headers and Footers, but it allows to embedded the changes into a custom modification of said module so that it can always automatized afterwards.

--- End quote ---

We don't plan to add such "smart" uninstallation as you suggest, currently. It would have problems of its own, because for example: some forums admins are very careful with security, and they might make some/most of the files unwritable, since they don't plan to uninstall Y1, Y2, Y3... SMF would fail, and not only that, but it would also do the unexpected thing (why would I expect it will keep uninstalling and installing undercover, mods I never told it to touch? and give errors about them being unwritable or unable to delete when I was trying something else; moreover the failure could be worse, in the middle of something, and finding out of the blue half-installed mods you never touched ... doesn't sound like a problem very easy to debug). Added to what you said - it may delete useful additional files. Custom modifications, too.

That said, I fully understand the problem, unfortunately I don't really think it's fully solvable with the modification system.
What would help IMHO (at least in a measure): seeing installation dates in package manager and being able to sort on them.

Just brainstorming: maybe it would help if package manager would be able, in case there are uninstallation errors, to display a list of mods previously installed, in addition to the error...?

Thoughts appreciated.

vbgamer45:
Just throwing this out there for code that is added using the add after or add before  but not replace the package manager should be able to find the original code that is added then just remove it but in the case of the replace it will still throw an error.

tmarques:

--- Quote from: Norv on December 03, 2010, 03:16:25 PM ---Another thread of interest on the same problem:
http://www.simplemachines.org/community/index.php?topic=381354.msg2631155#msg2631155

Thank you for the report.


--- End quote ---


No problem, I'm the one thankful for you looking into it.


I'll have a more in depth look soon, for now let me answer to what I think is appropriate before further reflection.


--- Quote ---About:

--- Quote from: tmarques on December 03, 2010, 02:38:09 PM ---I would like very much to see this solved in a way that if I want to uninstall module X and modules: Y1, Y2, Y3, Y4 and Y5 were installed after, SMF should uninstall all Yx modules, then the X module, then install all Yx modules again.
This would require that a list is shown before hand, since while installing and uninstalling topics one might run into problems with deleted helper files, like with Global Headers and Footers, but it allows to embedded the changes into a custom modification of said module so that it can always automatized afterwards.

--- End quote ---

We don't plan to add such "smart" uninstallation as you suggest, currently. It would have problems of its own, because for example: some forums admins are very careful with security, and they might make some/most of the files unwritable, since they don't plan to uninstall Y1, Y2, Y3... SMF would fail, and not only that, but it would also do the unexpected thing (why would I expect it will keep uninstalling and installing undercover, mods I never told it to touch? and give errors about them being unwritable or unable to delete when I was trying something else; moreover the failure could be worse, in the middle of something, and finding out of the blue half-installed mods you never touched ... doesn't sound like a problem very easy to debug). Added to what you said - it may delete useful additional files. Custom modifications, too.

--- End quote ---


I know, hence mentioning that this could be a toggle option and/or it should show which mods it would uninstall AND REINSTALL, after the module that can uninstall due to conflicts is actually removed.


Say you have:


M1
M2
M3
M4
M5


Installed by the order of the numbers, and you want to remove M2. You click the uninstall button, the forum checks it should uninstall M5, M4 and M3 before going to M2 and prints a warning:


Due to conflicts, will uninstall: M3, M4, M5 and reinstall, please check configurations for these modules are ok after M2 is successfully uninstalled.


In an even better way, the modification system would only uninstall M3, M4 and M5 if it tries to remove M2 and finds that not all sections are successful. An easier way would be to check if M3, M4 and M5 change files that M2 also does but that is very coarse and M2 may not need to remove those mods prior to a successful uninstall of M2 since M2 may change other areas of the same files that don't impact any of the other mods. This is not the most common behavior, as most modules tend to touch the same sections of code.


When I started using SMF this was actually something that I found strange but since I was coding modules, I got an understanding of the problem. I believe that most people that just install and uninstall packages will not understand why they are having problems and if they go ahead with the uninstalling, they will probably break the forum(has happened to me by related errors (not forced), multiple times) or will leave it in a difficult to maintain state.



--- Quote ---That said, I fully understand the problem, unfortunately I don't really think it's fully solvable with the modification system.
What would help IMHO (at least in a measure): seeing installation dates in package manager and being able to sort on them.

Just brainstorming: maybe it would help if package manager would be able, in case there are uninstallation errors, to display a list of mods previously installed, in addition to the error...?

Thoughts appreciated.


--- End quote ---


Yes, that would actually also be very helpful. The problem is having to uninstall them by hand increases maintenance times for upgrades, so I suggest having the optional automatic system but what you propose is a very good improvement to what is currently available and would also help other users that don't understand the problem to fix their forums in relatively easy way.
I understand this is a difficult problem to tackle, hence saying that I would be fully available to help with it.

Navigation

[0] Message Index

[#] Next page

Go to full version