Upgrade or rewrite Module for CMSMS 2

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
chriszeu
New Member
New Member
Posts: 3
Joined: Wed Jul 10, 2019 11:20 pm

Upgrade or rewrite Module for CMSMS 2

Post by chriszeu »

Hey there,

it's been a (a very long) while, I wrote a module for a small non-profit-organisation. It ran under CMSMS 1.11.
I forgot about it, but now they upgraded to CMSMS 2 and wonder, why nothing works anymore ^-^
I didn't follow the changes around CMSMS all the years, but I want to help them by repairing the module.
Is there a way to get an overview about the necessary changes to the code?

Thanks a lot!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Upgrade or rewrite Module for CMSMS 2

Post by calguy1000 »

There are several changes in the API's between CMSMS 1.11 and 2.2 (and more to come in the beta version)

Though you should be able to update your modules relatively easily with access to the error log.

The biggest changes are:
- We use multiple smarty templates, with scopes. So you cannot assume that a variable created in a module action template is available outside of that template.
- DON"T assume that $gCms is a global variable. though we do include it in scope for some things, you just can't assume that it's a global. Use cmsms() if you must.
- v2.0 removed the GetNotification... methods from the module API
- v2.0 removed a bunch of API methods that were deprecated in 1.12 or earlier. Even more stuff is deprecated now.
- v2.0 refactored the way that WYSIWYG and Syntax hilighter modules worked
- v2.0 broke admin themes.

i got this from the various threads in the announcements forum. Going as far back as the 2.0-beta1 announcement.

Note: The API documentation is reasonably up to date and lists most of the deprecated functions.

and to cover yourself for v2.3
- Make sure you aren't assuming paths to module files. Use GetModulePath() and GetModuleURLPath().
- Watch usage of $smarty->assign_by_ref()
- $this->smarty is gone out of the module api because of scopes.
- Modules that export content types cannot be lazy loaded.
- Prototypes to smarty plugins change because of newer versions of smarty.

---
if you have a specific question, just ask.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Upgrade or rewrite Module for CMSMS 2

Post by Rolf »

Might help: viewforum.php?f=83
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
chriszeu
New Member
New Member
Posts: 3
Joined: Wed Jul 10, 2019 11:20 pm

Re: Upgrade or rewrite Module for CMSMS 2

Post by chriszeu »

Rolf wrote:Might help: viewforum.php?f=83
I know the forum - it is the one, we are writing in ;-)
But I didn't find I a topic addressing my question - did I miss something?
chriszeu
New Member
New Member
Posts: 3
Joined: Wed Jul 10, 2019 11:20 pm

Re: Upgrade or rewrite Module for CMSMS 2

Post by chriszeu »

calguy1000 wrote:There are several changes in the API's between CMSMS 1.11 and 2.2 (and more to come in the beta version)

Though you should be able to update your modules relatively easily with access to the error log.

The biggest changes are:
- We use multiple smarty templates, with scopes. So you cannot assume that a variable created in a module action template is available outside of that template.
- DON"T assume that $gCms is a global variable. though we do include it in scope for some things, you just can't assume that it's a global. Use cmsms() if you must.
- v2.0 removed the GetNotification... methods from the module API
- v2.0 removed a bunch of API methods that were deprecated in 1.12 or earlier. Even more stuff is deprecated now.
- v2.0 refactored the way that WYSIWYG and Syntax hilighter modules worked
- v2.0 broke admin themes.

i got this from the various threads in the announcements forum. Going as far back as the 2.0-beta1 announcement.

Note: The API documentation is reasonably up to date and lists most of the deprecated functions.

and to cover yourself for v2.3
- Make sure you aren't assuming paths to module files. Use GetModulePath() and GetModuleURLPath().
- Watch usage of $smarty->assign_by_ref()
- $this->smarty is gone out of the module api because of scopes.
- Modules that export content types cannot be lazy loaded.
- Prototypes to smarty plugins change because of newer versions of smarty.

---
if you have a specific question, just ask.

Thanks - that is a good point to start from!
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Upgrade or rewrite Module for CMSMS 2

Post by Rolf »

chriszeu wrote:
Rolf wrote:Might help: viewforum.php?f=83
I know the forum - it is the one, we are writing in ;-)
But I didn't find I a topic addressing my question - did I miss something?

No, it is not the same board as the one we are in now...
It is a developers board in the CMSMS 2.0 beta board describing code updates to get modules ready for 2.0
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Developers Discussion”