Fatal error: Cannot redeclare after update

Fatal error: Cannot redeclare after update

by Stephan Tedesco -
Number of replies: 3

I made new module from the Face-To-Face plugin, in my f2fnew everything was renamed according to the moodle guidelines, but after upgrading the database it comes the same message for every function like the following:


"Fatal error: Cannot redeclare C:\xampp\htdocs\totara\mod\facetoface\lib.php:543) in C:\xampp\htdocs\totara\mod\ffnew\lib.php on line 556"


after fixing it just by removing

I get a lot of the following type:


"Notice: Constant MDL_F2F_NOTIFICATION_MANUAL already defined in"

As you can see I work on my local server, so it should load the start page, but it won't, any idea why?

I am using 2.8,

Thanks in advance.


S.


Average of ratings: -
In reply to Stephan Tedesco

Re: Fatal error: Cannot redeclare after update

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The guy who wrote the new plugin made a mistake... wink

It's not usually quite as simple as it first appears to 'clone' a module into a new version. Some of the dependencies may not be clear in respect of what must be renamed and what must not. I'm not sure how we can debug bugs in (your) code that we don't have access to...

In reply to Howard Miller

Re: Fatal error: Cannot redeclare after update

by Stephan Tedesco -
Thanks Howard, 


Everywhere we looked seemed to be "clean" from mistakes, I thought it can be something with the renaming of the dependencies, but wasn't sure. 


S.

In reply to Stephan Tedesco

Re: Fatal error: Cannot redeclare after update

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

grep for...

define('MDL_F2F_NOTIFICATION_MANUAL'

...you're going to find it twice I anticipate. What to do about that, depends on the circumstances.