Module.txt is Stateful?

Topics: Writing modules
Jan 6, 2012 at 8:48 AM

I used the command line tool to create a new module.  The first thing I did was modify the module.txt to be this:

Name: TableOfContents
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.0
OrchardVersion: 1.0
Description: Description for the module
FeaturesDescription: Yahoo!
Category: Navigation

After adding some code and launching the site, I decided to come back and modify the module.txt file to be this:

I used the command line tool to create a new module.  The first thing I did was modify the module.txt to be this:

Name: TableOfContents
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.0
OrchardVersion: 1.0
Description: Description for the module
Features:
    TableOfContents:
        Description: - Good Stuff.
  Steps: 1. Instructions.
      2. More Instructions.
      3. Final Instructions.
Category: Navigation

Once I did this, and refreshed my dashboard, my module completely disappeared from the module list!  After some fiddling, I discovered that I could make it return to the module list if I simply deleted the "Category: Navigation" line from the file.  I guessed it was somehow incompatible with the 'Features:' line?

But then I had a new problem: the modules list contained not one, BUT TWO entries for my "TableOfContents" part.  The only way I could restore normalcy to the system was by restoring the module.txt to the original contents it had.  What this tells me is that some or all of the modules.txt file is stored in the database, and modifying the file afterwards simply causes problems.

So I am curious, what can I do to convince Orchard to allow me to modify the module.txt file after it has already loaded once? 

By the way, in case this was a session issue, I did in fact decide to shut down the Orchard site and client browser and restart both between each step - and that still did not solve the problem.

Coordinator
Jan 6, 2012 at 8:56 AM

Your module disappeared at first because you had an improperly formatted manifest file: the category line needs to be indented.

The double entry in features is different. I would guess the folder for the module is not named TableOfContents. One of the entries is the default feature of the module (that has as its id the real folder name) and the other is your explicit feature.

There is no issue with modifying the module.txt file after creation. This just works without restarting anything. The issues you are seeing are not that.