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

[php] 'core.viewforum_modify_topics_data' add parameter forum_id

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.6
    • Fix Version/s: 3.1.11-RC1
    • Component/s: Events
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: