Extending the folder action to check for spaces and special characters

Currently when you create a folder that has the same name as something else in the folder you receive an error that says something like:

“Failed to add child objects to the folder”. These objects have non-unique names.

We would like to extend this to also check for spaces and special characters on creation of folders. Has anyone done this or have an example of how to do this?


You’ll need to create an “Effect” (it must implement the IPSEffect interface) on the Folder Content relationship. In the test() method, you will check the system title of the dependent item. If the title contains spaces / bad characters, return an error message (using the mechanism defined in PSEffectResult). This will cause the folder action to be suppressed, and the user will see an error message. Your new Effect does not need to do anything in the attempt() or recover() methods

If you want to limit this to new folders, check the ObjectType of the dependent object, and return Success when the dependent is a content item (not a folder).