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

[php] 'core.viewforum_modify_topics_data' add parameter forum_id

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.11-RC1
    • 3.1.6
    • Events
    • None

      I am using the event: 'core.viewforum_modify_topics_data', but frustratingly, the data does not easily tell me which forum is being displayed. It would seem to be sensible to add forum_id as a parameter.

      I can workaround the issue with the code:
      {{ //find the forum id... Unfortunately the event only gives us the topic ids, so we have to lookup.
      if (sizeof($topic_list))
      {
      // Generate topic forum list...
      $rowset = array();
      $rowset = $event['rowset'];
      $row = array();

      foreach ($topic_list as $topic_id)
      {
      $row = $rowset[$topic_id];
      if(!($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL))

      { $forum_id = $row['forum_id'] + 0; // only need one entry as we are only looking at one forum break; }

      }
      }}}

      but it would be much tidier to have the value passed with the event (and it would work in the corner case where the event contains no topics).

      Thinking a bit more... I think that there should be a policy that event data should always carry the identity of the instance that generated the event.

            Marc Marc
            v12mike v12mike
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: