Building Holidays module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
PageMaker
Forum Members
Forum Members
Posts: 10
Joined: Sun Feb 25, 2018 5:25 pm

Building Holidays module

Post by PageMaker »

I follow along the really excellent article by Robert Calguy1000 on how to build a module for CMSMS.
All went well until I reached page 3 where Robert says:
The module is installable at this point from the ModuleManager module...
Of course I like to try that, just to see that CMSMS recognizes my wonderfull do notting module. But as I went to the Module Manager in CMSMS 2.2.6 via WebSitebeheer >> Module Manager I see this:
Let op!

De getoonde versies zijn de laatste XML-versies die in de geselecteerde softwarebron zijn opgeslagen (meestal de CMS forge). Dit kunnen, maar hoeven niet, de laatste versies te zijn van de modules. Om te controleren of latere versies beschikbaar zijn, kan de zoekfunctie op de forge worden gebruikt, waarbij op de "Files" knop gedrukt kan worden.

Gebruik op eigen risico

De getoonde modules zijn gemaakt door zowel CMSMS ontwikkelaars, als derde partijen. Geen garanties op werkzaamheid, testen of compatibiliteit op je systeem kan worden gedaan. Aangeraden wordt om de informatie in de help en links te lezen alvorens te installeren.

Geïnstalleerd
0 Upgrade beschikbaar
Zoek
Beschikbare modules
Instellingen
Just a link to forge. How do I seduce CMCMS to recognize my Holiday module?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Building Holidays module

Post by velden »

If you did create the folder 'Holidays' (inside the /modules/ folder) and the file 'Holidays.module.php' (note that 'Holidays' should be spelled the same, also the case) it should be recognized by Module Manager.


I never tried myself, but it should work like that.

Example file/folder structure from the PDF:

Code: Select all

modules/Holidays/
\- Holidays.module.php
\- method.install.php
\- method.uninstall.php
\- lang
 \- en_US.php
PageMaker
Forum Members
Forum Members
Posts: 10
Joined: Sun Feb 25, 2018 5:25 pm

Re: Building Holidays module

Post by PageMaker »

With the exception of the Lang files the file structure seems OK to me.
Attachments
Schermafbeelding 2018-03-03 om 15.01.32.png
PageMaker
Forum Members
Forum Members
Posts: 10
Joined: Sun Feb 25, 2018 5:25 pm

Re: Building Holidays module

Post by PageMaker »

Well, looking again at your structure it seems that the statement on page 3 is a bit premature. Or I'm too curious. I'll add the files you mentioned and try again.
PageMaker
Forum Members
Forum Members
Posts: 10
Joined: Sun Feb 25, 2018 5:25 pm

Re: Building Holidays module

Post by PageMaker »

Too bad. No change after putting in the install and uninstall methods. Situation remains as in #1.
It strikes me as rather odd that after Websitebeheer >> Module Manager there's only that message.

Is it possible that there are some links missing in this part:
Geïnstalleerd
0 Upgrade beschikbaar
Zoek
Beschikbare modules
Instellingen
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Building Holidays module

Post by velden »

Now I tried and seems it's required to implement the GetVersion method.

Code: Select all

<?php 
	class Holidays extends CMSModule
	{
	  public function GetVersion() { return '1.0.'; }
	}
?>
That said, you probably would have noticed it if a proper error displaying /logging was enabled on the web server. During development that is quite useful.
PageMaker
Forum Members
Forum Members
Posts: 10
Joined: Sun Feb 25, 2018 5:25 pm

Re: Building Holidays module

Post by PageMaker »

Error logging gave me the clue:
#8 /Ap in /Applications/MAMP/htdocs/cmsms_test/modules/Holidays/Holidays.module.php on line 23
[03-Mar-2018 20:02:25 Europe/Amsterdam] PHP Fatal error: Uncaught Error: Call to undefined function GetChangelog() in /Applications/MAMP/htdocs/cmsms_test/modules/Holidays/Holidays.module.php:23
Stack trace:
This element in the article is still quit unclear.
Now the module shows in the Module Manager.
Thanks for the help.
Locked

Return to “Modules/Add-Ons”