Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
6dc860db
Commit
6dc860db
authored
Jan 18, 2015
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2406113
by fago: Clarify how ContentEntityForm::validate() should be overridden
parent
3e43de76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
core/lib/Drupal/Core/Entity/ContentEntityForm.php
core/lib/Drupal/Core/Entity/ContentEntityForm.php
+9
-0
No files found.
core/lib/Drupal/Core/Entity/ContentEntityForm.php
View file @
6dc860db
...
...
@@ -58,6 +58,15 @@ public function form(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*
* Note that extending classes should not override this method to add entity
* validation logic, but define further validation constraints using the
* entity validation API and/or provide a new validation constraint if
* necessary. This is the only way to ensure that the validation logic
* is correctly applied independently of form submissions; e.g., for REST
* requests.
* For more information about entity validation, see
* https://www.drupal.org/node/2015613.
*/
public
function
validate
(
array
$form
,
FormStateInterface
$form_state
)
{
$entity
=
$this
->
buildEntity
(
$form
,
$form_state
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment