Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fieldblock
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
fieldblock
Commits
71aac1fb
Commit
71aac1fb
authored
10 years ago
by
Marc van Gend
Browse files
Options
Downloads
Patches
Plain Diff
more consistent variable names
parent
9ce62adc
Branches
8.x-1.x
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fieldblock.module
+6
-6
6 additions, 6 deletions
fieldblock.module
with
6 additions
and
6 deletions
fieldblock.module
+
6
−
6
View file @
71aac1fb
...
@@ -55,19 +55,19 @@ function fieldblock_field_display_submit($form, FormStateInterface $form_state)
...
@@ -55,19 +55,19 @@ function fieldblock_field_display_submit($form, FormStateInterface $form_state)
$bundle
=
$form
[
'#bundle'
];
$bundle
=
$form
[
'#bundle'
];
$mode
=
$form
[
'#mode'
];
$mode
=
$form
[
'#mode'
];
/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $
view_mode_config
*/
/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $
entity_view_display
*/
$
view_mode_config
=
EntityViewDisplay
::
load
(
$entity_type
.
'.'
.
$bundle
.
'.'
.
$mode
);
$
entity_view_display
=
EntityViewDisplay
::
load
(
$entity_type
.
'.'
.
$bundle
.
'.'
.
$mode
);
$fields
=
$form_state
->
getValue
(
'fields'
);
$fields
=
$form_state
->
getValue
(
'fields'
);
foreach
(
$fields
as
$field_name
=>
$field
)
{
foreach
(
$fields
as
$field_name
=>
$field
)
{
if
(
isset
(
$field
[
'fieldblock'
])
&&
$field
[
'fieldblock'
]
==
1
)
{
if
(
isset
(
$field
[
'fieldblock'
])
&&
$field
[
'fieldblock'
]
==
1
)
{
$
view_mode_config
->
setThirdPartySetting
(
'fieldblock'
,
$field_name
,
$form
[
'fields'
][
$field_name
][
'human_name'
][
'#markup'
]);
$
entity_view_display
->
setThirdPartySetting
(
'fieldblock'
,
$field_name
,
$form
[
'fields'
][
$field_name
][
'human_name'
][
'#markup'
]);
}
}
else
if
(
$
view_mode_config
->
getThirdPartySetting
(
'fieldblock'
,
$field_name
))
{
else
if
(
$
entity_view_display
->
getThirdPartySetting
(
'fieldblock'
,
$field_name
))
{
$
view_mode_config
->
unsetThirdPartySetting
(
'fieldblock'
,
$field_name
);
$
entity_view_display
->
unsetThirdPartySetting
(
'fieldblock'
,
$field_name
);
}
}
}
}
$
view_mode_config
->
save
();
$
entity_view_display
->
save
();
// Invalidate the block cache to update fielblock derivatives.
// Invalidate the block cache to update fielblock derivatives.
if
(
\Drupal
::
moduleHandler
()
->
moduleExists
(
'block'
))
{
if
(
\Drupal
::
moduleHandler
()
->
moduleExists
(
'block'
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment