Prevent save & publish if editable is empty



I have a document type with two editables (date and input). I want to prevent saving (and publishing) the document if any of these editables are empty.

How can I achieve it? I tried to hook into “preSaveDocument” in a plugin. It’s fired, but I cannot stop the event propagation. Throwing one of pimcore.error.*Exception leads to an error “Uncaught exception” and the page freezes.

Do you have any idea?



You can make the fields required?


How can I do this? I didn’t find it in the documentation.


Make a property mandatory in the Object Definition:


I’m not talking about objects. I’m talking about document where I can use ‘$this->date()’ or ‘$this->input()’ in *.html.php


Oh sorry my bad… Good question :slight_smile: