We have moved to Github. Please open tickets there.

Opened 4 years ago

Closed 4 years ago

#608 closed Enhancement (fixed)

Offending mod can leave an Elgg site unusable

Reported by: tetrode Owned by:
Priority: normal Milestone: Elgg 1.5
Component: Core Version: 1.0
Severity: minor Keywords: mod
Cc: brettp Difficulty:

Description

When installing a mod with problems, it can leave the site completely useless, resulting in only a blank screen. I encountered this during the creation of my first mod. By going into the database:

SELECT m.id, n.string as name, v.string as value from elggmetadata m

JOIN elggentities e ON e.guid = m.entity_guid
JOIN elggmetastrings v on m.value_id = v.id
JOIN elggmetastrings n on m.name_id = n.id

WHERE n.string = 'enabled_plugins'
ORDER BY m.id;

followed by

DELETE FROM elggmetadata m
WHERE m.id = <offending_mod_id>;

I was able to repair it. It would be a good idea to have a possibility for the admin to go to a specific URL, log in with an admin account and view a list of the current enabled and disabled mods and have the ability to disable the offending mod.

Alternatively, Elgg could perhaps detect that a mod was not functioning correctly and not enable it...

As I am not well versed (yet) in Elgg/PHP I am not able to give a patch - perhaps in the future.

Best

Mark

Change History (4)

comment:1 Changed 4 years ago by marcus

There are limits to what PHP can do to detect parsing errors (basically it can't). I can see a need for an admin recovery tool and may do something like this in future.

comment:2 Changed 4 years ago by tetrode

You're right there, Marcus. Can you confirm that the queries are right? Then I can use these for my intermediate tool.

comment:3 Changed 4 years ago by tetrode

I found an easy solution. Change engine/lib/plugins, function load_plugin() as follows:

function load_plugins() {

global $CONFIG;


temporary disable all plugins
if (file_exists($CONFIG->pluginspath . "disabled"))

return;


Explanation: When a mod causes issues, upload a file called disabled to the mod folder. The system will then not load any mods. However, you can still go into the tool administration to disable the offending mod.

This way, there is no need to meddle in the database.

comment:4 Changed 4 years ago by marcus

  • Resolution set to fixed
  • Status changed from new to closed

(In [svn:2521]) Closes #608: Placing a file called "disabled" in mod now disables all plugins, allowing easier recovery of an elgg site with screwed up modules.

Note: See TracTickets for help on using tickets.