Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
301
Merge Requests
301
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
a7d29521
Commit
a7d29521
authored
Oct 15, 2013
by
jhodgdon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1879396
by babruix, jibran, xjm, juanolalla: Add inline docs to block classes
parent
19aeaa74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
core/modules/block/lib/Drupal/block/BlockBase.php
core/modules/block/lib/Drupal/block/BlockBase.php
+1
-4
core/modules/block/lib/Drupal/block/BlockFormController.php
core/modules/block/lib/Drupal/block/BlockFormController.php
+4
-0
No files found.
core/modules/block/lib/Drupal/block/BlockBase.php
View file @
a7d29521
...
...
@@ -121,8 +121,6 @@ public function blockForm($form, &$form_state) {
* Most block plugins should not override this method. To add validation
* for a specific block type, override BlockBase::blockValdiate().
*
* @todo Add inline documentation to this method.
*
* @see \Drupal\block\BlockBase::blockValidate()
*/
public
function
validateConfigurationForm
(
array
&
$form
,
array
&
$form_state
)
{
...
...
@@ -140,11 +138,10 @@ public function blockValidate($form, &$form_state) {}
* Most block plugins should not override this method. To add submission
* handling for a specific block type, override BlockBase::blockSubmit().
*
* @todo Add inline documentation to this method.
*
* @see \Drupal\block\BlockBase::blockSubmit()
*/
public
function
submitConfigurationForm
(
array
&
$form
,
array
&
$form_state
)
{
// Process the block's submission handling if no errors occurred only.
if
(
!
form_get_errors
())
{
$this
->
configuration
[
'label'
]
=
$form_state
[
'values'
][
'label'
];
$this
->
configuration
[
'label_display'
]
=
$form_state
[
'values'
][
'label_display'
];
...
...
core/modules/block/lib/Drupal/block/BlockFormController.php
View file @
a7d29521
...
...
@@ -299,9 +299,11 @@ public function validate(array $form, array &$form_state) {
form_set_value
(
$form
[
'id'
],
$form_state
[
'values'
][
'theme'
]
.
'.'
.
$form_state
[
'values'
][
'machine_name'
],
$form_state
);
}
if
(
!
empty
(
$form
[
'machine_name'
][
'#disabled'
]))
{
// Get machine name from original value (without prepended theme name).
$config_id
=
explode
(
'.'
,
$form_state
[
'values'
][
'machine_name'
]);
$form_state
[
'values'
][
'machine_name'
]
=
array_pop
(
$config_id
);
}
// Remove empty lines from the role visibility list.
$form_state
[
'values'
][
'visibility'
][
'role'
][
'roles'
]
=
array_filter
(
$form_state
[
'values'
][
'visibility'
][
'role'
][
'roles'
]);
// The Block Entity form puts all block plugin form elements in the
// settings form element, so just pass that to the block for validation.
...
...
@@ -331,6 +333,8 @@ public function submit(array $form, array &$form_state) {
$entity
->
save
();
drupal_set_message
(
$this
->
t
(
'The block configuration has been saved.'
));
// Invalidate the content cache and redirect to the block listing,
// because we need to remove cached block contents for each cache backend.
Cache
::
invalidateTags
(
array
(
'content'
=>
TRUE
));
$form_state
[
'redirect'
]
=
array
(
'admin/structure/block/list/'
.
$form_state
[
'values'
][
'theme'
],
array
(
'query'
=>
array
(
'block-placement'
=>
drupal_html_class
(
$this
->
entity
->
id
())),
...
...
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