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
0ac8abb2
Commit
0ac8abb2
authored
Aug 22, 2009
by
Dries
Browse files
- Patch
#137072
by ksenzee, rernst: block titles not copied on switching to a new theme.
parent
94abfae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/block/block.module
View file @
0ac8abb2
...
@@ -511,16 +511,15 @@ function block_theme_initialize($theme) {
...
@@ -511,16 +511,15 @@ function block_theme_initialize($theme) {
$default_theme
=
variable_get
(
'theme_default'
,
'garland'
);
$default_theme
=
variable_get
(
'theme_default'
,
'garland'
);
$regions
=
system_region_list
(
$theme
);
$regions
=
system_region_list
(
$theme
);
$result
=
db_query
(
"SELECT * FROM
{
block
}
WHERE theme = :theme"
,
array
(
':theme'
=>
$default_theme
),
array
(
'fetch'
=>
PDO
::
FETCH_ASSOC
));
$result
=
db_query
(
"SELECT * FROM
{
block
}
WHERE theme = :theme"
,
array
(
':theme'
=>
$default_theme
),
array
(
'fetch'
=>
PDO
::
FETCH_ASSOC
));
$query
=
db_insert
(
'block'
)
->
fields
(
array
(
'module'
,
'delta'
,
'theme'
,
'status'
,
'weight'
,
'region'
,
'visibility'
,
'pages'
,
'custom'
,
'cache'
));
foreach
(
$result
as
$block
)
{
foreach
(
$result
as
$block
)
{
// If the region isn't supported by the theme, assign the block to the theme's default region.
// If the region isn't supported by the theme, assign the block to the theme's default region.
if
(
!
array_key_exists
(
$block
[
'region'
],
$regions
))
{
if
(
!
array_key_exists
(
$block
[
'region'
],
$regions
))
{
$block
[
'region'
]
=
system_default_region
(
$theme
);
$block
[
'region'
]
=
system_default_region
(
$theme
);
}
}
$block
[
'theme'
]
=
$theme
;
$block
[
'theme'
]
=
$theme
;
$query
->
values
(
$block
);
unset
(
$block
[
'bid'
]);
drupal_write_record
(
'block'
,
$block
);
}
}
$query
->
execute
();
}
}
}
}
...
...
Write
Preview
Supports
Markdown
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