Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
book.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2006 at 19:06 UTC
Updated:
15 Dec 2006 at 10:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
hyperlogos commented*taptap* is this thing on?
Here's the code that looks like it's not doing what it's supposed to:
If $node->revision? I don't even know what this means. The only page I could find with a reference on the node object says "Revision number?" Not exactly inspiring. Drupal needs some, like, useful documentation someday.
But what makes me think of this is where I look further down:
So like, if you don't have the access right to administer nodes, then you get these values set for you. That seems very odd. Where are they set if you DO? Why would we want to specify a weight only for non-admins? This makes no sense to me :( I guess this is why comments are important.
I would try creating a new user like that but it doesn't seem to want to let me right now, off to go file another bug report.
Comment #2
hyperlogos commentedI went in and commented out lines 119, 120, and a closing brace } just a bit lower to enable the outline tab for books. It turns out that if I outline the books, they can be properly added to the book hierarchy. The only problem of course is that pathauto will not generate me a new path if I add them to the book in this fashion. If I then go in and edit the book page and save it, a new path is generated as appropriate.
At this point I guess the plan is to outline all of the book pages manually, then delete the aliases for all nodes whose type is book page, and finally use pathauto's settings to force alias creation. What a PITA.
I still want to know wtf $node->revision does...
Comment #3
pwolanin commentedIn book_submit, most of the code you cite is actually non-working. The variable $book does not exist (doh!).
The assignment of $node->revision = 1 forces the submission to be a new revision regardless of the workflow settings ( all of this is probably a bad remnant that should be removed). If $node->revision is TRUE, the node is saved as an new entry in the database with a new revision ID ($node->vid). Weight is probably set to zero as non-NULL a default- only admins can set the book weight (for some reason) on the node edit form.
Comment #4
chx commentedNeeds a backport, too.
Comment #5
pwolanin commentedI'd rather see these lines deleted than corrected- is it really the desired behavior to change the authorship of the node to whoever edited it last?
Also, I don't think there is any effect from setting $node->name
Comment #6
chx commentedChanging behaviour is a feature requet and a separate issue. I am fixing a bug.
I read node_submit and found that the $node->name to $node->uid translation indee dhapppens before hook_submit is called. Therefore that line is pointless now. Rerolled.
Comment #7
pwolanin commentedok, +1 for RTBC
Comment #8
dries commentedCommitted to CVS HEAD. Thanks.
Comment #9
killes@www.drop.org commentedbackported
Comment #10
(not verified) commented