unable to uninstall add-on

Permalink
Hi everyone!

After the installation of the add-on Internationalization (which I had to install manually since I had problems with the normal installation) I cannot create new pages anymore. I got the "Fatal error: Cannot redeclare class MultilingualSection".

The first thing I tried was to uninstall the add-on, but after I input the okay for the uninstall, there is no confirmation of the actual uninstall and the add-on stays there.

What can I do?

Thanks in advance for your help

 
JohntheFish replied on at Permalink Reply
JohntheFish
Are you on C5 version 5.6?
fornap replied on at Permalink Reply
yep
JohntheFish replied on at Permalink Reply
JohntheFish
I ran in to some similar issues when updating my own addons. There is a difference in the way 5.6 loads classes that glitches with classes being loaded more than once.

The solution I adopted was to track down the relevant 'Loader::' statements for the class (in your example, there will be a class somewhere within the addon in a file multilingual_section.php), and a Loader::xxwhateverxx statement such as Loader::library or Loader::model etc somewhere else in the package that does Loader::xxwhateverxx('multilingual_section' ....)

The hack is to enclose it in a test:
if (!class_exists('MultilingualSection')){
  Loader::xxwhateverxx('multilingual_section' ....);
}


This code is not exact, it just illustrates a principle that you can adapt to each specific problem.
fornap replied on at Permalink Reply
and is there a way just to uninstall the add-on?
I have realised now that the pages were actually created, and now if I try to delete them the page keeps loading but nothing happens, a bit like it works for the uninstallation of the add-ons...

For the moment maybe I can solve using a backup of 2 days ago and avoid to install add-ons again, but I'm a bit scared now. I've chosen Concrete5 for its semplicity, but of course it has to be reliable as well. I'm not very good in coding, and if I have to tweak something I usually loose a lot of time :D
JohntheFish replied on at Permalink Reply
JohntheFish
In general, Concrete5 is very reliable. Issues like this can arise about major upgrades, especially if an addon is not yet updated for the C5 version. In those situations you can get a chicken and egg problem (like you have), where the addon is installed, but breaks before you can do anything with it (like uninstall it and/or update it). In 5.6 these glitches seem to be focussed on loading classes because the whole internal mechanism for loading changed.

If you can't get it working well enough to uninstall, hacking the database tables is not a particularly safe option because it can leave inconsistencies between tables unless you catch all the little details. Personally, I prefer hacking the php. A trick I have used in with problem addons in the PRB is to hack the package controller to prune out anything that is not directly needed to uninstall the offending package (having made a backup copy first), pruning away until I get something that will uninstall.

Have you contacted the addon developer through the addon support page?
fornap replied on at Permalink Reply
No, I haven't contacted them yet.
I think I'll start from scratch with another Concrete installation, do you suggest to avoid to use the version 5.6 of Concrete?
JohntheFish replied on at Permalink Reply
JohntheFish
No, a fresh v5.6.0.2 install is the best possible starting point for a new installation.

The trick is to make 2 installations, 1 for the live site, and 1 for a development site (possibly also a third 'staging' site)

Install the live site first, connect it to C5, then create the development site by database backup/restore. That will give both the same marketplace connection.

Before you put any marketplace package (or code) on the live site, test it first on the development site (with a backup first).

Some prefer to create content forward, editing on the development site and then copy all by backup/restore to the live site. Others prefer to create content on the live site and copy back. In most cases developers start with the first, then at some stage in the project switch to the second.
fornap replied on at Permalink Reply
Thank you very much for this suggestion, I'll do that way!