We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27519
    • 275 Posts
    My module is going to create some MODx elements like categories and chunks as part of the creation process of some of its entities. For example (it’s a property rental application), when a new property is created the module also creates a category for chunks for booking confirmations and payment reminders and default email chunks inside those categories.

    Although this works fine, I found myself copying quite a bit of MODx’s validation logic. This logic is currently located in the different processors. An example: a category is created by create.php in core/model/modx/processors/element/category and checks permissions and the fact that the category name is not empty.

    If that logic was re-located with the specific class (for example for categories, a category would know how to check permissions and validate its attributes before a save is performed), that would make that code reusable / accessible.

    Does that make sense?
      MODx Revolution / MAMP / OS X