title: Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Core_Model_Design_Package::getPackageByUserAgent()
body: <p>I was getting a 500 error once I moved my magento 1.9 install from an old server to a new server. The old server was running php5 and this one is on 7. I am now getting the following error and I know I have to change some of the code, but I am not sure what:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Core_Model_Design_Package::getPackageByUserAgent() must be of the type array, object given, called in /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php on line 576 and defined in /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php:586 Stack trace: #0 /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php(576): Mage_Core_Model_Design_Package::getPackageByUserAgent(Object(Zend_Log), 'design/theme/te...') #1 /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php(262): Mage_Core_Model_Design_Package->_checkUserAgentAgainstRegexps('design/theme/te...') #2 /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php(287): Mage_Core_Model_Design_Package->getTheme('template') #3 /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php(420): Mage_Core_Model_Design_Package->updateParamDefaults(Array) #4 /home1/acapps/flagstuff.com/app/code/core in /home1/acapps/flagstuff.com/app/code/core/Mage/Core/Model/Design/Package.php on line 586</p>
  </blockquote>
  
  <p>This is the code that starts on line 586 of Package.php</p>
  
  <pre class="lang-php prettyprint-override"><code>public static function getPackageByUserAgent(array $rules, $regexpsConfigPath = 'path_mock')
  
  {
          foreach ($rules as $rule) {
  
              if (!empty(self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']])) {
  
                  self::$_customThemeTypeCache[$regexpsConfigPath] = $rule['value'];
  
                  return $rule['value'];
  
              }
  
              $regexp = '/' . trim($rule['regexp'], '/') . '/';
  
              if (@preg_match($regexp, $_SERVER['HTTP_USER_AGENT'])) {
                  self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']] = true;
  
                  self::$_customThemeTypeCache[$regexpsConfigPath] = $rule['value'];
                  return $rule['value'];
              }
          }
  
          return false;
      }
  </code></pre>