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

JavaScript console throws error when alert message title is not defined (core.js bug)

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b3
    • Fix Version/s: 3.1.0-b4
    • Component/s: JavaScript / AJAX
    • Labels:
      None

      Description

      On line 309 of core.js there's a check:

      if (typeof res.MESSAGE_TITLE !== 'undefined') {
      	alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
      } else {
      	dark.fadeOut(phpbb.alertTime);
      }
      

      On lines 333-337 the code is to hide alert on page refresh but there's no check if alert is undefined:

      // Hide the alert even if we refresh the page, in case the user
      // presses the back button.
      dark.fadeOut(phpbb.alertTime, function() {
      	alert.hide();
      });

      Thus, if 'MESSAGE_TITLE' is not defined, JS console (Firebug/etc) throws error on page refresh:

      TypeError: alert is undefined
      alert.hide()

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            bantu Andreas Fischer
            Reporter:
            rxu Ruslan Uzdenov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development