Jump to content

[Hint] Error 500 after modules update


ceberlin
 Share

Recommended Posts

If you get a compile error (Error 500) when updating a module (for example with the ModuesManager), 

this could be for a likely but not so obvious reason. I want to share this. 

Example alert (Maintenance Module update example):

Compile Error: 
Cannot redeclare class MaintenanceMode (line 3 of /.../site/modules/MaintenanceMode/MaintenanceMode.module)
 

This looks like an attempt to declare the same module class twice.

What had happened here was this:

When dragging a module over an ftp client to the modules folder, it got placed inadvertedly into another module folder and not 

in the modules root. - So the module became "invisible" (hidden) on your ftp client at first glance. 

The funny thing was that the misplaced module was still working alright. No alarm bells rang.

Trouble came after we tried to update the module (by ftp or by the modules manager) months later.

Then the infamous error 500 appeared.

So, before wasting time looking closely at database entries and module codes, maybe check first whether there is a duplicate of the updated module buried in the modules folder somewhere.

  • Like 1
Link to comment
Share on other sites

Modules Manager doesn't check the modules location before updating. Though when you placed it in the wrong spot to begin with manually it get's quirky.

Depending on the module and how the user manually installed the module previously and how he named the folder it can mess things up. It's a known issue, I think we need to keep in mind when migrating the ModulesManager to the core soon. Currently ModulesManager creates a folder with the "classname" entered when adding a module on modules.processwire.com, it's the only reliable info we got from the module feed, so it has to take that when creating the folder.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...