Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9842

Template Display Hook bug with Attachments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 3.0.7-PL1
    • Other
    • None

      I noticed that when hooking a function into template->display like this:
      $phpbb_hook->register(array('template','display'), 'my_hook');

      The function/hook is executed during the compilation of the template as expected, but if you are viewing a topic that has Attachments in the post, then the function/hook is repeated at every attachment as well.

      For example, I made a hook that would simply echo "hello world" and this phrase appeared in the viewtopic page wherever there was an attachment, after the <dd> tag, like this:

      <dl class="attachbox">
      <dt>Attachments</dt>
      <dd>hello world
      <dl class="thumbnail">

      Obviously this means more complex functions that are hooked in to the template->display will be executed multiple times when there are attachments!

            Marc Marc
            VSE Matt Friedman [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: