Hi! I just installed the acidfree module and, man, this is great! Way, way better than any other album module for Drupal out there. Thanks for sharing!

One thing... on the bottom of every album and individual photo I get these weird "Add Child Page" links that allow me (or any other user for my site, which is a lot worse) to create book pages that tie to the album/photo. What, book pages? Is this right? How do I turn these links off?

Also, how do you configure the theme the module uses? I can't seem to find a setting for this.

And last but not least... my thumbnails appear in these gray boxes that are kind of cool: http://rpg.turnodanoite.com/node/564

However, when I'm editing albums/photos I get to see those cute little blue folder pictures behind the thumbnails. So I'm guessing these blue folders should also appear on the normal album view instead of the grey boxes. Anything I should do about that?

CommentFileSizeAuthor
#9 book.module.link.patch418 bytesvhmauery

Comments

ricmadeira’s picture

Hmm... actually those little blue folders appear on this page here: http://rpg.turnodanoite.com/node/563

It's an album that contains the another album I linked on my previous post and nothing else.

Weird. If I resize the album.gif so that the thumbnails will fit do I have to make other changes elsewhere (like on album.xcf)?

ricmadeira’s picture

Okay, and forget my question about the theme thing... I've just noticed it's a theme for the whole site, not just the acidfree module. Duh!

ricmadeira’s picture

Version: master » 4.6.x-1.x-dev

Okay, forget everything I said except for the "Add Child Page" problem. I was getting weird layouts and bugs because I mistakenly used the CVS version instead of the 4.6 one (my Drupal version is 4.6.3).

So my only real problem now is those "Add Child Page" links. They appear to site users even when I turn off their permission to "Create Acidfree elements" in Access Control. How do I get rid of them?

vhmauery’s picture

This sounds like a book issue, not an acidfree issue. Maybe the book nodeapi functions are modifying the acidfree output. Are you using the book module? If not, disable it. Otherwise, I am not sure what to tell you. Change the access controls for book stuff?

ricmadeira’s picture

Disabling user rights to create book pages makes the "Add Child Page" links go away, alright. Unfortunately, me and my users need to keep on using the book module. There must be another way...

I don't know much about drupal or PHP, but it seems to me that those links should only occur when $node->type == 'book'

Are acidfree media pages considered book nodes by drupal? Can't we change that somehow?

ricmadeira’s picture

Component: User interface » Code
Category: support » bug

Hmm.... $node->type for acidfree nodes seems fine (i.e. $node->type == 'acidfree')... strange. I wonder why do the book.module links get inserted there then?

Anybody else having this problem?

ricmadeira’s picture

I'm guessing it is a simple matter of tweaking these lines in acidfree.module:

function acidfree_link($type, $node = 0, $main) {
    $links = array();
    if ($type == 'node' && $node->type == 'acidfree') {
        // Don't display a redundant edit link if they are node administrators.
        if (acidfree_access('update', $node) && !user_access('administer nodes')) {
            // determine whether or not we are actually viewing an album or a node
            $links[] = l(t("edit this {$node->class}"), "node/$node->nid/edit");
        }
    }
    return $links;
}

Not sure what to do, though... I've searched drupal.org and I've come across hacks/patches that seem to remove unwanted links from the $links variable, but I can't figure them out. PHP is really not my thing... at least not yet.

ricmadeira’s picture

Take this code here, for example, taken from http://drupal.org/node/32745#comment-57793

$links[] = l(t("email this ".$e_l_t), "emailpage&nid=$node->nid", array("title" => t("Email this page to a friend"), 'class' => 'email-page'), NULL);

It supposedly removes unwanted "E-mail this page" links... Only I'm not sure how to change this to remove the "Add child page" and "Printer-friendly version" links I'm getting.

vhmauery’s picture

StatusFileSize
new418 bytes

I figured it out!!! The problem is that book and acidfree nodes both have a member called parent. The function book_link only checks to see if parent is set, not if it is actually a book node type. Test this patch out and let me know if it fixes it. If it does, we should submit it to the book maintainer.

spazfox’s picture

This works perfectly for me. Keeps the "add a child page" link fully functional on the book pages, but removes the link for my acidfree pages. Nice catch!

vhmauery’s picture

Status: Active » Closed (duplicate)

I opened a bug against book.module and am marking this bug a duplicate of that bug.

This bug is a duplicate of Remove book links from non-book nodes.