Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
features-3455219
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
features-3455219
Commits
bab2d219
Commit
bab2d219
authored
4 years ago
by
Andreas Hennings
Browse files
Options
Downloads
Plain Diff
Merge '3183346-regression-overridden-features' by donquixote, nedjo, kruser, torotil into 7.x-2.x.
Reported by: kruser, torotil. Reviewed by: nedjo.
parents
12aa9549
a58b8de5
No related branches found
Branches containing commit
Tags
5.x-2.7
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
features.export.inc
+2
-8
2 additions, 8 deletions
features.export.inc
features.install
+33
-4
33 additions, 4 deletions
features.install
with
35 additions
and
12 deletions
features.export.inc
+
2
−
8
View file @
bab2d219
...
...
@@ -1033,9 +1033,6 @@ function features_set_signature($module, $component, $signature = NULL, $message
* that were using a -dev branch after 7.x-2.11.
* Since #3162854, it is stored in a dedicated non-cache table.
*
* @param bool $reset
* TRUE, to reset the static cache.
*
* @return string
* One of 'table', 'cache' or 'type'.
* On a fully updated database, this value will be 'table'.
...
...
@@ -1044,11 +1041,8 @@ function features_set_signature($module, $component, $signature = NULL, $message
* @see \features_set_signature()
* @see \features_update_7202()
*/
function
_features_get_signature_storage_type
(
$reset
=
FALSE
)
{
static
$type
;
if
(
$reset
)
{
$type
=
NULL
;
}
function
_features_get_signature_storage_type
()
{
$type
=
&
drupal_static
(
__FUNCTION__
);
if
(
$type
!==
NULL
)
{
return
$type
;
}
...
...
This diff is collapsed.
Click to expand it.
features.install
+
33
−
4
View file @
bab2d219
...
...
@@ -76,6 +76,8 @@ function features_uninstall() {
variable_del
(
'features_ignored_orphans'
);
variable_del
(
'features_feature_locked'
);
variable_del
(
'features_lock_mode'
);
variable_del
(
'features_update_7202_fixed_tmp'
);
variable_del
(
'features_update_7202_possibly_broken'
);
db_delete
(
'variable'
)
->
condition
(
'name'
,
'features_admin_show_component_%'
,
'LIKE'
)
...
...
@@ -246,10 +248,10 @@ function features_update_7202() {
db_create_table
(
'features_signature'
,
$schema
);
}
// Load existing signatures.
if
(
db_table_exists
(
'cache_features'
))
{
// The original version of the previous update has already run.
if
(
db_table_exists
(
'cache_featurestate'
))
{
// The old version of features_update_7201() has run in the past, and a
// cache table was created to replace the 'features_codecache' variable.
$cache
=
cache_get
(
'features_codecache'
,
'cache_featurestate'
);
$signaturess
=
!
empty
(
$cache
->
data
)
?
$cache
->
data
...
...
@@ -257,7 +259,8 @@ function features_update_7202() {
$message
=
__FUNCTION__
.
'() - from cache storage'
;
}
else
{
// The update is from an earlier version of features.
// The current (inactive) version of features_update_7201() has run, and the
// 'features_codecache' variable still exists.
$signaturess
=
variable_get
(
'features_codecache'
,
array
());
$message
=
__FUNCTION__
.
'() - from variable storage'
;
}
...
...
@@ -297,12 +300,19 @@ function features_update_7202() {
// On failure, allow the exception to trickle up.
$insert
->
execute
();
// Set a temporary marker variable for subsequent updates.
// This variable was not set in an older version of this update.
variable_set
(
'features_update_7202_fixed_tmp'
,
TRUE
);
// Delete the old table and variable if the data migration was successful.
variable_del
(
'features_codecache'
);
if
(
db_table_exists
(
'cache_featurestate'
))
{
db_drop_table
(
'cache_featurestate'
);
}
// Reset the static cache that determines the storage type.
drupal_static_reset
(
'_features_get_signature_storage_type'
);
}
/**
...
...
@@ -325,3 +335,22 @@ function features_update_7203() {
'not null'
=>
TRUE
,
));
}
/**
* Set a marker variable, if the site could be affected by undesired reverts.
*/
function
features_update_7204
()
{
if
(
variable_get
(
'features_update_7202_fixed_tmp'
))
{
// The fixed version of features_update_7202() did run.
// Delete the temporary marker variable.
variable_del
(
'features_update_7202_fixed_tmp'
);
}
else
{
// Either the old broken version of features_update_7202() ran, or features
// was newly installed in a version where 7202 or 7203 was the latest
// update.
// Set a marker variable, indicating that some overridden features
// components might have been accidentally reverted. See #3183346.
variable_set
(
'features_update_7202_possibly_broken'
,
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