Uploaded attachments not showing with paged nodes

peterpoe - October 4, 2007 - 17:21
Project:Paging
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:patch (code needs work)
Description

The problem is that paging is overwriting the $node->body variable on lines 136-137 (_paging_nodeapi function):

          $node->body = check_markup($node->pages[$page], $node->format, false);
          $node->body .= theme('pager', NULL, 1, $element);

I changed the lines to:
          $node->content['body']['#value'] = check_markup($node->pages[$page], $node->format, false);
          $node->content['body']['#value'] .= theme('pager', NULL, 1, $element);

and the attachments show. Don't know if this can cause other problems though...

#1

baldwinlouie - March 6, 2008 - 03:42
Status:active» patch (code needs review)

I've been running this change in production for a while now. It shouldn't cause any problems. I took your changes above and made a patch for it.

AttachmentSize
paging.180845.patch634 bytes

#2

baldwinlouie - March 13, 2008 - 19:39

I made a slight tweak to the patch. Instead of concatenating the pager into the body, I put it in its own array element. This way, it will be easier to override.

AttachmentSize
paging.180845_1.patch750 bytes

#3

sun - June 4, 2008 - 00:20
Status:patch (code needs review)» patch (code needs work)

Please read http://drupal.org/patch/create

#4

Gurpartap Singh - July 3, 2008 - 22:54

The suggested changes break: http://drupal.org/node/133961

 
 

Drupal is a registered trademark of Dries Buytaert.