Event manager- duplicate this plugin

Hello,

 

I want to dupplicate the plugin Event Manager. In fact I want to be able to use this plugin two times in the same site, in order to separate two types of events.

I tried to change the name of the file, to replace the name by another one in the whole folder but It doesn't work... What can I do?

Tha^nks for help...

  • Luckily or unfortunately you can not copy a plugin, rename the folder and expect it to work. You can however configure event 'types' in de event manager plugin. Is that what helps? The events will not be seperated in the listing, but you will be able to search for them specifically in the advanced search features of event manager...

  • I renamed also all the occurrences in the files, not only the folder...

    I am looking for a way to have two separated listings, two widget, one for each type of event

     

    Thanks for your help

     

  • You also need to change the subtype name used in your clone and you need to rename the classes used by the plugin. The function names must be renamed, too, to be unique. The content of the vendors folder must be left unchanged but the rest will need to be reworked. If if fails to work, you have forgotten to rename something or made a mistake at renaming.

  • Thanks for answering. I just need to change all words "event" by another word? In all folder except vendor? It will be enough to clone the plugin?

  • I changed all the occurrence in all the files (corps) and all the file and folders name. It still doesn't work. I have a error page and this message: Impossible d'inclure start.php pour le plugin anim_manager (GUID : 562)

    The plugin appears in the plugin list (administrator panel) but when I try to activate it, an error 500 appears...

    I just replaced all the words "event" by "anim". Everywhere. Should I do something more?

    thanks

  • You also need to change the plugin id in manifest.xml to match the name of your cloned plugin folder name. Originally it's

    <id>event_manager</id>

    Change it and see if this changes anything on plugin activation. You should also check the server error log to find out what is the cause of errors. This might give some indicaton what you might have forgotten to rename.

  • I changed the ID, but the same error...

    In the log I have:

    activate,plugin 500 (Elgg\Database\Plugins)->invalidateIsActiveCache
  • Can I send you somewhere the modified folder if you have the time to check it? Thanks

  • Sorry. But I really don't have the time to debug.

    My guess is that you still haven't correctly renamed/modified the classes. In the classes subfolder several classes are defined. You need to rename the classes (both the filename and the class name in the file and these two must be the same). You also need to change the value of the SUBTYPE constant in the classes. Then you need to change the classnames in activate.php and deactivate.php to match your new classnames. And you need to change any occurance of the classnames elsewhere in the plugin code (e.g. if a new object of this class is created).

  • Thanks a lot for your answer. I'll try this and hope it will works.