Closed (duplicate)
Project:
Acidfree Albums
Version:
4.6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2005 at 13:18 UTC
Updated:
5 Dec 2005 at 16:55 UTC
A user just reported to me that the "printer-friendly" link on photo pages wasn't working. When I looked, I discovered that drupal was adding a book type link (for example, "http://www.chesmontastro.org/?q=book/print/220") to every photo page.
Can someone tell me why this link is appearing and how I supress it?
I'm running drupal 4.6.4 and the december 2nd version of acidfree.
Comments
Comment #1
mwheinz commentedSo is something making drupal confuse books and acidfree albums?
Comment #2
mwheinz commentedOkay, I'm not at all familiar with the drupal code, but poking around it looks like the bug is in book.module, not acidfree.module. Here's a possible patch, but I'm not sure I like what it implies - does drupal really call every single module for every page view?
*** /mirror/var.0/www/www.chesmontastro.org.drupal/modules/book.module Fri Jul 29 03:29:25 2005
--- book.module Mon Dec 5 08:59:17 2005
***************
*** 55,61 ****
$links = array();
! if ($type == 'node' && isset($node->parent)) {
if (!$main) {
if (book_access('create', $node)) {
$links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
--- 55,61 ----
$links = array();
! if ($type == 'node' && isset($node->parent) && $node->type == 'book') {
if (!$main) {
if (book_access('create', $node)) {
$links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
Comment #3
vhmauery commentedYou are right in saying this is a book.module problem. And yes, every module does get invoked for lots of stuff. That is what the nodeapi stuff is all about. For each action (load, insert, modify, delete, form, view, etc.) EVERY module gets called and the affected node gets passed. It makes for a very simple interaction between modules.
The book module assumes that EVERY node with a parent field must be a book and adds the links when viewing. I already have a bug open on this and seem to have been ignored for a long time. Either way, I am marking this as a duplicate of that bug -- http://drupal.org/node/34363