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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.0-b4
    • 3.1.0-b3
    • JavaScript / AJAX
    • None

      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()

            bantu Andreas Fischer [X] (Inactive)
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: