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
27349905
Commit
27349905
authored
Jan 19, 2013
by
webchick
Browse files
Issue
#1848998
by dawehner, chx, xjm: Fixed Module/Bundle services not available in update.php.
parent
9fa3ce39
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/includes/update.inc
View file @
27349905
...
...
@@ -633,6 +633,7 @@ function update_module_enable(array $modules) {
// installed module is always 0. Using 8000 here would be inconsistent
// since $module_update_8000() may involve a schema change, and we want
// to install the schema as it was before any updates were added.
module_load_install
(
$module
);
$function
=
$module
.
'_schema_0'
;
if
(
function_exists
(
$function
))
{
$schema
=
$function
();
...
...
core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
View file @
27349905
...
...
@@ -108,4 +108,16 @@ public function testVariableUpgrade() {
}
}
}
/**
* Check whether views got enabled.
*/
public
function
testFrontpageUpgrade
()
{
$this
->
assertTrue
(
$this
->
performUpgrade
(),
'The upgrade was completed successfully.'
);
// Reset the module enable list to get the current result.
module_list_reset
();
$this
->
assertTrue
(
module_exists
(
'views'
),
'Views is enabled after the upgrade.'
);
}
}
core/modules/system/system.install
View file @
27349905
...
...
@@ -2194,6 +2194,25 @@ function system_update_8045() {
}
}
/**
* Enable Views if the node listing is set as the frontpage.
*/
function
system_update_8046
()
{
$front_page
=
config
(
'system.site'
)
->
get
(
'page.front'
);
if
(
!
isset
(
$front_page
)
||
$front_page
==
'node'
)
{
update_module_enable
(
array
(
'views'
));
// Register views to the container, so views can use it's services.
$module_list
=
drupal_container
()
->
getParameter
(
'container.modules'
);
drupal_load
(
'module'
,
'views'
);
drupal_container
()
->
get
(
'kernel'
)
->
updateModules
(
array_keys
(
$module_list
),
array
(
'views'
=>
'core/modules/views/views.module'
));
// This does not fire a hook just calls views.
config_install_default_config
(
'module'
,
'views'
);
}
}
/**
* @} End of "defgroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
...
...
core/modules/views/views.install
View file @
27349905
...
...
@@ -26,3 +26,17 @@ function views_schema() {
return
$schema
;
}
/**
* Provide an initial schema.
*
* @see update_module_enable().
*/
function
views_schema_0
()
{
module_load_install
(
'system'
);
// Add the cache_views_info and cache_views_results tables.
$cache_schema
=
system_schema_cache_8007
();
$schema
[
'cache_views_info'
]
=
$cache_schema
;
$schema
[
'cache_views_results'
]
=
$cache_schema
;
return
$schema
;
}
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