Guidance for Updating Modules during Development

Posted by Community Admin on 04-Aug-2018 15:23

Guidance for Updating Modules during Development

All Replies

Posted by Community Admin on 23-Dec-2011 00:00

At least for me, development is an iterative process (especially when interacting with a third party system).  Make a small change, build the project, and see if the change had the desired effect is the normal workflow.

Unfortunately a custom module's install method is only called when the module is first registered.  Thus any changes to the configuration are not applied when we rebuild a module with a series of small changes to the module's UI definition code and/or pages.  Thus the assumption for developing a new module is that you are going to code the whole thing in one go and everything will be perfect.  I don't know about you, but I seldom get everything right on the first go around.

So I guess my questions are:
1.) When is the Update method on ModuleBase\ContentModuleBase called?  Specifically, what conditions trigger its invocation?
2.) What is the best practice for undoing the previous installation and re-installing the module?  During development the path of least resistance would be to delete the previous configuration settings including service registration (aka taxonomy), automatically update database using Open Access auto-generated scripts, and run the install method again with the changes.
3.) Can you provide a video/sample/documentation with instructions and best practices for updating a previously registered module.

Note: I have figured out that if I change the assembly version number Open Access will automatically update the database with any changes.


Posted by Community Admin on 28-Dec-2011 00:00

Hi,

1. This is done by changing the version number of the module (I see you already have this.) In AssemblyInfo.cs

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
2. Removing the version number and module ID from SystemConfig.config should do the trick to apply any changes made to the module, however to completely install the module as it was never installed before
I have tested with the SQL script from this forum post and it was working, it is removing the module tables and thus erasing any leftovers from its previous install, however this method is more inconvenient and making modification to a database managed by ORM may trigger errors I suggest doing a test on a test project.
3. These are the reccomended ways of updating a module,
 All the best,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed