Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9842

Template Display Hook bug with Attachments

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 3.0.7-PL1
    • None
    • Other
    • None

    Description

      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!

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: