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

retrieve_block_vars generates warnings in PHP 7.2

XMLWordPrintable

    Error rendering 'com.atlassian.jira.jira-view-issue-plugin:details-module'. Please contact your Jira administrators.

      When there are no items in the specified block name the following is produced:

      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/template/context.php on line 289: count(): Parameter must be an array or an object that implements Countable
      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/template/context.php on line 301: Invalid argument supplied for foreach()
      

      Ran into this while doing a custom extension that deals with the navlinks and happens on the index page where there are no navlinks. This is the code:

      $navlinks = $this->template->retrieve_block_vars('navlinks', array());

      If I DO specify the variable name I'm looking for the error list gets reduced to just the first one.

            nicofuma nicofuma
            DavidIQ David Colón
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: