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

[php] 'core.viewforum_modify_topics_data' add parameter forum_id

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.6
    • 3.1.11-RC1
    • Events
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: