Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
content_lock-3214991
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
content_lock-3214991
Commits
66aae360
Commit
66aae360
authored
7 years ago
by
Christian Fritsch
Committed by
Christian Fritsch
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2940857
by chr.fritsch, kfritsche: Views integration broken
parent
8588d57f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content_lock.install
+27
-0
27 additions, 0 deletions
content_lock.install
with
27 additions
and
0 deletions
content_lock.install
+
27
−
0
View file @
66aae360
...
...
@@ -80,3 +80,30 @@ function content_lock_update_8001(&$sandbox) {
drupal_uninstall_schema
(
'content_lock'
);
drupal_install_schema
(
'content_lock'
);
}
/**
* Use boolean instead of content_lock_field views field plugin.
*/
function
content_lock_update_8002
(
&
$sandbox
)
{
$config_factory
=
\Drupal
::
configFactory
();
// Find all views configs.
foreach
(
$config_factory
->
listAll
(
'views.view.'
)
as
$view_config_name
)
{
$view
=
$config_factory
->
getEditable
(
$view_config_name
);
// Go through each display on each view.
$displays
=
$view
->
get
(
'display'
);
foreach
(
$displays
as
$display_name
=>
$display
)
{
// Go through all the entity fields on each display and find ones
// currently using 'date' as the plugin.
if
(
!
empty
(
$display
[
'display_options'
][
'fields'
]))
{
foreach
(
$display
[
'display_options'
][
'fields'
]
as
$field_name
=>
$field
)
{
if
(
$field
[
'field'
]
===
'is_locked'
&&
$field
[
'plugin_id'
]
===
'content_lock_field'
)
{
// Update the field to use the new plugin.
$base
=
"display.
$display_name
.display_options.fields.
$field_name
"
;
$view
->
set
(
$base
.
'.plugin_id'
,
'boolean'
);
}
}
}
}
$view
->
save
(
TRUE
);
}
}
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