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

Issues with template->destroy and template->set_custom_template

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.6
    • 3.0.x
    • Other
    • None
    • PHP Environment: 5.2.10
      Database: MySQL 5.0.81

      I have a mod that instantiates a new template object then recursively uses the object to display different blocks, setting a new custom template path (template->set_custom_template) for each block, setting a template file (template->set_filenames), destroys the template, then starts over again. It would look something like this:

      $mtemplate = new template();
      foreach ($blocks as $row)
      {
            $mtemplate->set_custom_template(...);
            $data = call_block_function($row);
            $template->assign_block_vars('sidebar', array(
                  'BLOCK_TITLE'        => $data['title'],
                  'BLOCK_CONTENT'  => $data['content'])
            );
            $mtemplate->destroy();
      }

      This worked fine prior to 3.0.6 but as of 3.0.6-RC1, destroying the template leads to template issues: Some blocks turn up blank, some variables are not assigned and things like that. I have to destroy the template because some blocks are called more than ones and use the same template file to display different things based on the block settings. I have not been able to figure out the problem but it almost seems when the template is destroyed, template->set_filenames must be set first (which is inconvenient in some instances) prior to assigning any template variables. I'm I missing something or do I smell a bug?

            Acyd Burn Meik Sievertsen [X] (Inactive)
            Blitze Blitze [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: