Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3604231d
Commit
3604231d
authored
Mar 07, 2010
by
webchick
Browse files
#521838
follow-up by jrchamp: Clean up drupal_get_schema_versions().
parent
88941380
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/install.inc
View file @
3604231d
...
...
@@ -95,6 +95,11 @@ function drupal_get_schema_versions($module) {
$updates
=
&
drupal_static
(
__FUNCTION__
,
NULL
);
if
(
!
isset
(
$updates
[
$module
]))
{
$updates
=
array
();
foreach
(
module_list
()
as
$loaded_module
)
{
$updates
[
$loaded_module
]
=
array
();
}
// Prepare regular expression to match all possible defined hook_update_N().
$regexp
=
'/^(?P<module>.+)_update_(?P<version>\d+)$/'
;
$functions
=
get_defined_functions
();
...
...
@@ -117,7 +122,7 @@ function drupal_get_schema_versions($module) {
sort
(
$module_updates
,
SORT_NUMERIC
);
}
}
return
isset
(
$updates
[
$module
])
?
$updates
[
$module
]
:
FALSE
;
return
empty
(
$updates
[
$module
])
?
FALSE
:
$updates
[
$module
];
}
/**
...
...
includes/update.inc
View file @
3604231d
...
...
@@ -1041,11 +1041,13 @@ function update_get_update_function_list($starting_updates) {
foreach
(
$starting_updates
as
$module
=>
$version
)
{
$update_functions
[
$module
]
=
array
();
$updates
=
drupal_get_schema_versions
(
$module
);
$max_version
=
max
(
$updates
);
if
(
$version
<=
$max_version
)
{
foreach
(
$updates
as
$update
)
{
if
(
$update
>=
$version
)
{
$update_functions
[
$module
][
$update
]
=
$module
.
'_update_'
.
$update
;
if
(
$updates
!==
FALSE
)
{
$max_version
=
max
(
$updates
);
if
(
$version
<=
$max_version
)
{
foreach
(
$updates
as
$update
)
{
if
(
$update
>=
$version
)
{
$update_functions
[
$module
][
$update
]
=
$module
.
'_update_'
.
$update
;
}
}
}
}
...
...
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