We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20135
    • 188 Posts
    Have just upgraded to REVO 2.2.2 and am now getting this error multiple times on every page load:


    [2012-05-17 10:21:09] (ERROR @ /index.php) [OnWebPagePrerender]

    <b>Notice</b>: Undefined index: browser in <b>/var/www/html/core/cache/includes/elements/modplugin/6.include.cache.php</b> on line <b>201</b>



    <b>Notice</b>: Undefined index: browser in <b>/var/www/html/core/cache/includes/elements/modplugin/6.include.cache.php</b> on line <b>131</b>



    <b>Notice</b>: Undefined index: browser in <b>/var/www/html/core/cache/includes/elements/modplugin/6.include.cache.php</b> on line <b>131</b>



    No other errors, and no idea what's causing it. Any clues?
      • 3749
      • 24,544 Posts
      What is the plugin with the ID of 6 (in parentheses next to the plugin name in the Elements tree)?

      You can disable the plugin by editing it and checking the "disabled" checkbox and saving it.

      You can also fix the code of the plugin to eliminate the warning. It's telling you that that line in the plugin is referencing an array index called 'browser' that doesn't exist.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 20135
        • 188 Posts
        That got rid of the error. The Plugin was the MobileDetection package. Should I make a notification to the developers of the issue?
          • 3749
          • 24,544 Posts
          Yes, the fix is probably very easy and the problem may affect a number of people.

          BTW, here is a fix, not necessarily the right fix, but I think it may stop the messages:


          Around line 125 of the plugin, change this code:

          function get_user_prefs() {
          	return $_COOKIE['browser'];
          }


          to this:

          function get_user_prefs() {
              return isset($_COOKIE['browser']) ? $_COOKIE['browser'] : '';
          }




          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 4 months ago.]
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 20135
            • 188 Posts
            Ok, thanks.