This patch enforces the use of the book_allowed_types variable, a list of node types that are allowed to be in a book outline. Normally, the Book Outline tab is always available, meaning the "book_allowed_types" administrative variable isn't being used.

Comments

Status: Needs review » Needs work

The last submitted patch, book-7.x-dev-check-allowed-content-types.patch, failed testing.

wjaspers’s picture

Status: Needs work » Needs review
StatusFileSize
new655 bytes

Line endings, .... AGAIN. ARGHHHH.

Status: Needs review » Needs work

The last submitted patch, book-7.x-dev-1196576-check-allowed-content-types.patch, failed testing.

wjaspers’s picture

Status: Needs work » Needs review
StatusFileSize
new707 bytes

Third time's a charm?

wjaspers’s picture

Huh, I put "FALSE" instead of node_type_get_types().
Here's a patch with the correction.

wjaspers’s picture

This is the last one, I swear. This patch checks the outline tab, too, as I had missed it in the previous patch.

wjaspers’s picture

Oops, this is a duplicate issue.
See: http://drupal.org/node/502430

Leaving this issue open to let core maintainers decide how to proceed.

carole’s picture

subscribe

Renee S’s picture

I vastly prefer this approach to fixing the bug. Simple, and makes the module behave as described (needs a few modifications for D6 - node_get_types() instead of node_type_get_types() and the form function is named slightly differently, but if mods decide to go ahead with this version I'll submit a patch.)

justmagicmaria’s picture

I also vastly prefer this approach. Can we get this committed?

wjaspers’s picture

Just cleaning up my issue queue.
Since this issue is a bit dated, it's probably best to retest the most recent patch.

wjaspers’s picture

jvieille’s picture

this is an original Drupal issue.
The fix for D6:

function book_form_alter(&$form, $form_state, $form_id) {

  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
    // Add elements to the node form
    $node = $form['#node'];
+// Don't display book form elements on non book nodes edit forms
+  if (!book_type_is_allowed($node->type)) {
+    return ;
+  }
$access = user_access('administer book outlines');
...
dagomar’s picture

Status: Needs review » Closed (duplicate)

I'm gonna go ahead and close this issue. It is in essence the same as #502430: Allow the book outline functionality on non-book-enabled node types to be hidden from users with the "Administer book outlines" permission, however there the proposed solution is an extra setting in the Book settings. I've added/updated a patch there that does just that.