Skip to content

Commit

Permalink
Directly cast $book_node_type to object
Browse files Browse the repository at this point in the history
  • Loading branch information
kiamlaluno committed Mar 5, 2024
1 parent 8b0cb5c commit 21c89a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/modules/book/book.install
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function book_uninstall() {
*/
function _book_install_type_create() {
// Create an additional node type.
$book_node_type = array(
$book_node_type = (object) array(
'type' => 'book',
'name' => t('Book page'),
'base' => 'node_content',
Expand All @@ -42,7 +42,6 @@ function _book_install_type_create() {
),
);

$book_node_type = (object) $book_node_type;
node_type_save($book_node_type);
node_add_body_field($book_node_type);
}
Expand Down

0 comments on commit 21c89a4

Please sign in to comment.