Kentico custom module classes are not creating staging tasks

Dustin Christians asked on November 8, 2018 12:49

I recently created a new custom module and added 4 new classes within that module. I added the info and provider code to the project along with the extra code needed to make the data stage-able and I found that when I create new data within the class the data shows up in the staging app but the class objects do not. Therefore, I can't sync the data because I can't sync the class objects that hold the data if staging tasks don't get created for the class objects.

I've tried saving the classes again and there still aren't staging tasks for them. I saved the module again and synced it to the next site but the classes still aren't there.

Any ideas?

I'm using Kentico v11.0.21

Correct Answer

David te Kloese answered on November 8, 2018 12:59

Nope just the data, check: https://docs.kentico.com/k11/custom-development/creating-custom-modules#Creatingcustommodules-Exportingcustommodules

"Deployment of modules using content staging is NOT supported."

You could use Import/export. Make sure the class is customizable and then you'll see it in Export under System tables.

Not sure but perhaps your own Compare for Kentico can do it ^_^

0 votesVote for this answer Unmark Correct answer

Recent Answers


Dustin Christians answered on November 8, 2018 14:12

Thanks for the answer David. I'm confused about that quote because I certainly did stage the module and synced it to another Kentico instance. There is also a lot of information in the documentation about setting up staging for class data. Module classes are essentially just custom tables and custom tables along with their data can be staged. Does anyone know why module classes don't create staging tasks so I can explain to our clients why they must export and import the module into all of their sites to get the classes? Is there some sort of technical reason that makes it impossible or did Kentico decide they didn't want to support this?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on November 8, 2018 14:16

I guess because of potential generated classes that might be compiled. So Kentico can't just place those provider/info classes on the target file system.

0 votesVote for this answer Mark as a Correct answer

Dustin Christians answered on November 8, 2018 14:19

Are you talking about the same generated info/provider classes that get created for page types and custom tables?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on November 8, 2018 14:44

What David provided means you cannot deploy your module using Content Staging. You physically need to export/import the module, recreate it on the target server OR create a package for it. You can however stage over the classes once the module is created on the target server by enabling staging for it. Maybe you've already done this since you're seeing the items already in staging?

https://docs.kentico.com/k11/custom-development/creating-custom-modules/setting-the-type-information-for-module-classes/enabling-export-and-staging-for-the-data-of-classes#Enablingexportandstagingforthedataofclasses-Enablingstagingsupport

0 votesVote for this answer Mark as a Correct answer

Dustin Christians answered on November 19, 2018 20:23

Thank you David and Brenden for the help.

As both of you mentioned, you cannot stage module classes and that appears to be correct as far as I can tell. You can stage a module and you can add code (using Brenden's links, which I did do and it does work) to stage class data.

To export the module classes to another site I went to the "Sites" app within Kentico, then "Export", then "Do not preselect any objects". I then unchecked the "Export files" checkbox and unchecked the "Export tasks" checkbox because I only needed the module class objects. I then found the custom module under "Development" then "Modules" and selected that checkbox only. That created the export zip for me. I imported the zip file into the next site and the classes were added correctly. After importing the module classes I was able to sync the module class data just fine.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.