Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
views_bootstrap
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
views_bootstrap
Commits
a57d221c
Commit
a57d221c
authored
8 months ago
by
Shelane French
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3473829
by shelane, marc.bau: Migration from 8.x-3.10 to 5.5.0-rc1 break several views
parent
1ffd37ac
No related branches found
No related tags found
1 merge request
!33
adds update hook for unsupported styles
Pipeline
#282743
passed
8 months ago
Stage: build
Stage: validate
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views_bootstrap.install
+53
-2
53 additions, 2 deletions
views_bootstrap.install
with
53 additions
and
2 deletions
views_bootstrap.install
+
53
−
2
View file @
a57d221c
...
...
@@ -8,7 +8,7 @@
/**
* Update Views Bootstrap style configuration for Bootstrap 5 options.
*/
function
views_bootstrap_update_91001
(
&
$sandbox
)
{
function
views_bootstrap_update_91001
(
&
$sandbox
)
:
void
{
$config_factory
=
\Drupal
::
configFactory
();
foreach
(
$config_factory
->
listAll
(
'views.view.'
)
as
$view_config_name
)
{
...
...
@@ -53,7 +53,7 @@ function views_bootstrap_update_91001(&$sandbox) {
/**
* Update Views Bootstrap Dropdown classes.
*/
function
views_bootstrap_update_91002
(
&
$sandbox
)
{
function
views_bootstrap_update_91002
(
&
$sandbox
)
:
void
{
$config_factory
=
\Drupal
::
configFactory
();
foreach
(
$config_factory
->
listAll
(
'views.view.'
)
as
$view_config_name
)
{
...
...
@@ -78,3 +78,54 @@ function views_bootstrap_update_91002(&$sandbox) {
}
}
}
/**
* Update Views Bootstrap from older versions.
*/
function
views_bootstrap_update_91003
(
&
$sandbox
)
:
void
{
$config_factory
=
\Drupal
::
configFactory
();
foreach
(
$config_factory
->
listAll
(
'views.view.'
)
as
$view_config_name
)
{
$view
=
$config_factory
->
getEditable
(
$view_config_name
);
$save
=
FALSE
;
$displays
=
$view
->
get
(
'display'
);
foreach
(
$displays
as
$display_name
=>
&
$display
)
{
if
(
!
empty
(
$display
[
'display_options'
][
'style'
])
&&
!
empty
(
$display
[
'display_options'
][
'style'
][
'options'
]))
{
$style
=
(
string
)
$display
[
'display_options'
][
'style'
][
'type'
];
// Check for thumbnail.
if
(
$style
==
'views_bootstrap_thumbnail'
)
{
$display
[
'display_options'
][
'style'
][
'type'
]
=
'views_bootstrap_cards'
;
$display
[
'display_options'
][
'style'
][
'options'
][
'row_class'
]
=
$display
[
'display_options'
][
'style'
][
'options'
][
'row_class_custom'
];
$display
[
'display_options'
][
'style'
][
'options'
][
'row_class_default'
]
=
$display
[
'display_options'
][
'style'
][
'options'
][
'default_row_class'
];
$display
[
'display_options'
][
'style'
][
'options'
][
'card_group_class_custom'
]
=
$display
[
'display_options'
][
'style'
][
'options'
][
'col_class_custom'
];
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'alignment'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'automatic_width'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'col_xs'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'col_sm'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'col_md'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'col_lg'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'row_class_custom'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'default_row_class'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'col_class_custom'
]);
\Drupal
::
logger
(
'views_bootstrap'
)
->
notice
(
"Updating options in
$display_name
for
$view_config_name
"
);
$save
=
TRUE
;
}
// Check for panel.
elseif
(
$style
==
'views_bootstrap_panel'
)
{
$display
[
'display_options'
][
'style'
][
'type'
]
=
'views_bootstrap_cards'
;
$display
[
'display_options'
][
'style'
][
'options'
][
'card_title_field'
]
=
$display
[
'display_options'
][
'style'
][
'options'
][
'panel_title_field'
];
$display
[
'display_options'
][
'style'
][
'options'
][
'card_group_class_custom'
]
=
$display
[
'display_options'
][
'style'
][
'options'
][
'contextual_class'
];
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'panel_label_field'
]);
unset
(
$display
[
'display_options'
][
'style'
][
'options'
][
'panel_footer_field'
]);
\Drupal
::
logger
(
'views_bootstrap'
)
->
notice
(
"Updating options in
$display_name
for
$view_config_name
"
);
$save
=
TRUE
;
}
}
}
if
(
$save
)
{
$view
->
set
(
'display'
,
$displays
);
$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