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

Undefined index when adding logs from extensions

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-RC2
    • Fix Version/s: 3.1.0-RC3
    • Component/s: Extensions
    • Labels:
      None

      Description

      My extension adds a moderator log entry when a moderator makes a change. Since my extension does not rely on a forum_id or topic_id, an error is thrown for undefined indexes (see screenshot). Here's the relevant section:

      $forum_id = (int) $additional_data['forum_id'];
      unset($additional_data['forum_id']);
      $topic_id = (int) $additional_data['topic_id'];
      unset($additional_data['topic_id']);

      We should probably check if these are set using isset() and then setting them to 0 if not.

        Activity

        Hide
        nickvergessen Joas Schilling added a comment -

        You should not use the predefined log types or provide what they need.

        Show
        nickvergessen Joas Schilling added a comment - You should not use the predefined log types or provide what they need.
        Hide
        tmbackoff Tabitha Backoff [X] (Inactive) added a comment -

        From IRC:

        [12:15:44] <tmbackoff> Extension authors shouldn't have to provide variables if they are not using them in their extension
        [12:28:47] <nickvergessen> hmm
        [12:28:53] <nickvergessen> well prepare a patch for it

        Show
        tmbackoff Tabitha Backoff [X] (Inactive) added a comment - From IRC: [12:15:44] <tmbackoff> Extension authors shouldn't have to provide variables if they are not using them in their extension [12:28:47] <nickvergessen> hmm [12:28:53] <nickvergessen> well prepare a patch for it
        Hide
        tmbackoff Tabitha Backoff [X] (Inactive) added a comment -

        Add isset() to forum_id and topic_id

        Show
        tmbackoff Tabitha Backoff [X] (Inactive) added a comment - Add isset() to forum_id and topic_id

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            tmbackoff Tabitha Backoff [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development