<p>As other answers have touched on, the behaviour you're seeing is by design.</p>

<p>I've written a plugin called <a href="https://github.com/mmikkel/AlwaysValidate-Craft" rel="nofollow">Always Validate</a> which will make Craft validate all disabled entries and categories – including entry drafts or entries saved by users not permitted to publish – which should solve your issue.</p>

CC BY-SA 3.0
2016-03-10T17:45:29.293Z
2016-03-10T17:45:29.293Z
Mats Mikkel Rummelhoff
<p>That's the idea behind Drafts, to store entries not yet ready to publish, unfinished ones so to speak.</p>

<p>I think it does make sense to not validate the fields. Good feature!</p>

CC BY-SA 3.0
2016-03-10T09:51:01.403Z
Well, in my case it does not make sense. The title should be at least mandatory, because the user should able to identify the entry a way or an other in the list. This also means that that user group will not have the feeling that they are responsible of the content, but they are.
pvledoux
CC BY-SA 3.0
2016-03-10T09:55:22.170Z
What if they haven't decided on a title yet. You can always tell them to enter one? If it's really important for you (you didn't tell the whole story yet, so there might be reasons), you could write a simple plugin that listens to onBeforeSaveEntry events.
carlcs
CC BY-SA 3.0
2016-03-10T10:01:33.823Z
Ok, with the responsibility reason, you're onto something. But there should be other ways to handle it than restricting the Drafts feature. I mean, those users want to have their content published eventually, so you need to find a way to make them clear to put some effort into creating or editing entries.
carlcs
CC BY-SA 3.0
2016-03-10T01:24:43.657Z
2016-03-10T01:24:43.657Z
carlcs
<p>As carlcs said, this is already working as expected. Craft only enforces content validation rules for <em>enabled</em> entries (not including drafts), and most people prefer that behavior.</p>

<p>If you want to change that behavior, you can write a <a href="https://craftcms.com/docs/plugins/introduction">plugin</a> that provides its own entry validation logic, by latching onto the <a href="https://craftcms.com/docs/plugins/events-reference#entries-onBeforeSaveEntry">entries.onBeforeSaveEntry</a> event. Just put this in your plugin’s primary class:</p>

<pre class="lang-php prettyprint-override"><code>public function init()
{
    craft()-&gt;on('entries.beforeSaveEntry', function(Event, $event) {
        /** @var EntryModel $entry */
        $entry = $event-&gt;params['entry'];

        // If the entry is disabled, the content won't be validated automatically
        if (!$entry-&gt;enabled)
        {
            $validates = craft()-&gt;content-&gt;validateContent($entry);

            if (!$validates)
            {
                // Add the content validation errors
                $entry-&gt;addErrors($entry-&gt;getContent()-&gt;getErrors());

                // Prevent the entry from getting saved
                $event-&gt;performAction = false;
            }
        }
    });
}
</code></pre>

CC BY-SA 3.0
2016-03-10T17:13:04.467Z
Actually, I already wrote [that plugin](https://github.com/mmikkel/AlwaysValidate-Craft) :)
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-03-10T17:30:41.467Z
@MatsMikkelRummelhoff Oh great! You should post as a new answer ;)
Brandon Kelly
CC BY-SA 3.0
2016-03-10T17:34:55.340Z
Sure – will do :)
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-03-10T15:09:54.153Z
2016-03-10T15:09:54.153Z
Brandon Kelly
<p>when a user with no permission to publish is submitting a blank entry, the entry is saved anyway without any errors.</p>

<p>Here is the permissions set to the user group:</p>

<p><a href="https://i.sstatic.net/hHjeB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hHjeB.png" alt="permissions"></a></p>

<p>I have few required field as showed below:</p>

<p><a href="https://i.sstatic.net/Wl3yq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Wl3yq.png" alt="new entry"></a></p>

<p>And very sadly, the entry is saved as draft, entitled "New Entry":</p>

<p><a href="https://i.sstatic.net/BcD9H.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BcD9H.png" alt="entry is saved"></a></p>

<p>This can't be a feature, is it?</p>

<validation><user-groups><permissions><saveentry>
Entry validation not working when Publish live changes permission is not checked
# Entry validation not working when Publish live changes permission is not checked

(Asked by: username_0 on 2016-03-09)

when a user with no permission to publish is submitting a blank entry, the entry is saved anyway without any errors.

Here is the permissions set to the user group:

[![permissions](https://i.sstatic.net/hHjeB.png)](https://i.sstatic.net/hHjeB.png)

I have few required field as showed below:

[![new entry](https://i.sstatic.net/Wl3yq.png)](https://i.sstatic.net/Wl3yq.png)

And very sadly, the entry is saved as draft, entitled "New Entry":

[![entry is saved](https://i.sstatic.net/BcD9H.png)](https://i.sstatic.net/BcD9H.png)

This can't be a feature, is it?

**Tags:** validation, user-groups, permissions, saveentry

---

## 3 answers

### Answer by username_3 on 2016-03-10. Score: 5 | Accepted answer

As carlcs said, this is already working as expected. Craft only enforces content validation rules for enabled entries (not including drafts), and most people prefer that behavior.
If you want to change that behavior, you can write a plugin that provides its own entry validation logic, by latching onto the entries.onBeforeSaveEntry event. Just put this in your plugin’s primary class:
public function init()
{
    craft()->on('entries.beforeSaveEntry', function(Event, $event) {
        /** @var EntryModel $entry */
        $entry = $event->params['entry'];

        // If the entry is disabled, the content won't be validated automatically
        if (!$entry->enabled)
        {
            $validates = craft()->content->validateContent($entry);

            if (!$validates)
            {
                // Add the content validation errors
                $entry->addErrors($entry->getContent()->getErrors());

                // Prevent the entry from getting saved
                $event->performAction = false;
            }
        }
    });
}

> **Comments:**
> **username_1**: Actually, I already wrote [that plugin](https://github.com/mmikkel/AlwaysValidate-Craft) :)  
> **username_3**: @MatsMikkelRummelhoff Oh great! You should post as a new answer ;)  
> **username_1**: Sure – will do :)  

---

### Answer by username_1 on 2016-03-10. Score: 4

As other answers have touched on, the behaviour you're seeing is by design.

I've written a plugin called [Always Validate](https://github.com/mmikkel/AlwaysValidate-Craft) which will make Craft validate all disabled entries and categories – including entry drafts or entries saved by users not permitted to publish – which should solve your issue.


---

### Answer by username_2 on 2016-03-10. Score: 3

That's the idea behind Drafts, to store entries not yet ready to publish, unfinished ones so to speak.

I think it does make sense to not validate the fields. Good feature!

> **Comments:**
> **username_0**: Well, in my case it does not make sense. The title should be at least mandatory, because the user should able to identify the entry a way or an other in the list. This also means that that user group will not have the feeling that they are responsible of the content, but they are.  
> **username_2**: What if they haven't decided on a title yet. You can always tell them to enter one? If it's really important for you (you didn't tell the whole story yet, so there might be reasons), you could write a simple plugin that listens to onBeforeSaveEntry events.  
> **username_2**: Ok, with the responsibility reason, you're onto something. But there should be other ways to handle it than restricting the Drafts feature. I mean, those users want to have their content published eventually, so you need to find a way to make them clear to put some effort into creating or editing entries.  

---

