When creating an instance, only the book's root has an author specified. All subpages are set to Anonymous. This patch fixes this, as well as allows users to specify a node author. This patch still needs validation set up for users which don't exist, so it's waiting on #351943: Allow a template to be used for the book introduction which I'll be committing shortly. It should also check for permission to change authors.

Comments

deviantintegral’s picture

StatusFileSize
new4.88 KB

Here is an updated patch which applies against HEAD and implements username validation. It currently adds a new 'set outline authors' permission, with the intent to not have to give users the administer nodes permission. Unfortunately, drupal_execute() still respects that permission, so something different will need to be done to allow the author to be set, or instead we'll just have to use 'administer nodes' as the permission to check.

deviantintegral’s picture

Status: Needs work » Needs review
StatusFileSize
new4.31 KB

It turns out that changing an author without having the "administer nodes" permission is problematic. There is work going in for Drupal 7 to remove the administer nodes permission and split up it's functionality; when that eventually is released, this feature can be changed to take advantage of it. For now, for consistency with the rest of how Drupal works, it requires the 'administer nodes' permission.

agentrickard’s picture

You could also run an UPDATE query to manually set the UID after node creation, which is hackish, but practical.

deviantintegral’s picture

Status: Needs review » Fixed

Yeah, I may do that in the future, but for now I'm trying to keep away from directly modifying the tables if I can.

I've committed the patch in #2.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.