1

Any ideas why the system.log in magento system is full of this error?

2012-09-04T06:37:25+00:00 ERR (3): Notice: Undefined index: HTTP_USER_AGENT in /var/www//app/code/core/Mage/Core/Model/Design/Package.php on line 588

we are using Magento Enterprise 1.10, when I was goolging for any hints, seems like it may have something to do with the design theme exception in system->configuration...

samuel.sung
  • 11
  • 1
  • 2

1 Answers1

5

This is technically a bug in Magento, as this variable is assumed to be set when it in fact may not be set.

Reported here with backlink: http://www.magentocommerce.com/bug-tracking/issue?issue=14194

Edit: adding simple patch

    if (!isset($_SERVER['HTTP_USER_AGENT']) || empty($_SERVER['HTTP_USER_AGENT'])) {
        return false;
    }
Community
  • 1
  • 1
benmarks
  • 23,384
  • 1
  • 62
  • 84
  • does it mean we have to "patch" it up ourselves for the time being to prevent this from flooding the log file, correct? – samuel.sung Sep 05 '12 at 23:30
  • 1
    Yep. Patch code above. This would be an example of a potentially acceptable app/code/local/Mage/ override ;-) - just remember to merge in new changes in a new version. – benmarks Sep 06 '12 at 11:27
  • @benmarks I am also facing the same issue, it would be great if you can let me know where do I need to place the above mentioned code. – Anshu Mishra Aug 24 '15 at 04:26