Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
31c357f9
Commit
31c357f9
authored
Aug 26, 2007
by
Dries Buytaert
Browse files
- Patch
#170004
by pwolanin: removed db_num_rows() in book_update_6000.
parent
be9b7e30
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/book/book.install
View file @
31c357f9
...
...
@@ -150,20 +150,10 @@ function book_update_6000() {
$update_count
=
400
;
// Update this many at a time
$result
=
db_query_range
(
"SELECT * FROM
{
book_temp
}
"
,
$_SESSION
[
'book_update_6000_orphans'
][
'from'
],
$update_count
);
if
(
db_num_rows
(
$result
))
{
$_SESSION
[
'book_update_6000_orphans'
][
'from'
]
+=
$update_count
;
}
else
{
// Done with this part
if
(
!
empty
(
$_SESSION
[
'book_update_6000_orphans'
][
'book'
]))
{
// The orphans' parent is added last, so it will be processed first.
$_SESSION
[
'book_update_6000'
][]
=
$_SESSION
[
'book_update_6000_orphans'
][
'book'
];
}
$_SESSION
[
'book_update_6000_orphans'
]
=
FALSE
;
}
$has_rows
=
FALSE
;
// Go through the next $update_count book pages and locate the orphans.
while
(
$book
=
db_fetch_array
(
$result
))
{
$has_rows
=
TRUE
;
// Orphans are defined as nodes whose parent does not exist in the table.
if
(
$book
[
'parent'
]
&&
!
db_result
(
db_query
(
"SELECT COUNT(*) FROM
{
book_temp
}
WHERE nid = %d"
,
$book
[
'parent'
])))
{
if
(
empty
(
$_SESSION
[
'book_update_6000_orphans'
][
'book'
]))
{
...
...
@@ -179,6 +169,17 @@ function book_update_6000() {
}
}
}
if
(
$has_rows
)
{
$_SESSION
[
'book_update_6000_orphans'
][
'from'
]
+=
$update_count
;
}
else
{
// Done with this part
if
(
!
empty
(
$_SESSION
[
'book_update_6000_orphans'
][
'book'
]))
{
// The orphans' parent is added last, so it will be processed first.
$_SESSION
[
'book_update_6000'
][]
=
$_SESSION
[
'book_update_6000_orphans'
][
'book'
];
}
$_SESSION
[
'book_update_6000_orphans'
]
=
FALSE
;
}
$ret
[
'#finished'
]
=
FALSE
;
return
$ret
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment