{"id":432,"date":"2018-11-06T01:06:22","date_gmt":"2018-11-06T01:06:22","guid":{"rendered":"https:\/\/kevingoedecke.com\/?p=432"},"modified":"2018-11-06T01:06:22","modified_gmt":"2018-11-06T01:06:22","slug":"magento-1-x-error-on-php-7-2","status":"publish","type":"post","link":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/","title":{"rendered":"Magento 1.x Error on PHP 7.2"},"content":{"rendered":"<p>After upgrading on of my clients environment from PHP7 to PHP 7.2, the client reported not being able to open any customers in the admin dashboard. The logs showed the following error:<\/p>\n<pre class=\"lang:default decode:true\">PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on line 34<\/pre>\n<p>To fix this I add to overwrite a few Magento core files and change the function\u00a0<span class=\"lang:default decode:true  crayon-inline \">getAllOptions<\/span>\u00a0.<\/p>\n<p>In order to still be able to update your Magento shop, copy the following files from <span class=\"lang:default decode:true  crayon-inline \">\/app\/code\/core\/<\/span>\u00a0 to\u00a0\u00a0<span class=\"lang:default decode:true  crayon-inline\">\/app\/code\/local<\/span>\u00a0.<\/p>\n<p>Now copy the following files to you local folder:<\/p>\n<pre class=\"lang:default decode:true  \">\/app\/code\/core\/Mage\/Customer\/Model\/Resource\/Address\/Attribute\/Source\/Country.php\r\n\/app\/code\/core\/Mage\/Customer\/Model\/Entity\/Address\/Attribute\/Source\/Country.php\r\n\/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Group.php\r\n\/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php<\/pre>\n<p class=\"p1\">In those files you need to replace the following line<\/p>\n<pre class=\"lang:default decode:true\">public function getAllOptions()<\/pre>\n<p>with<\/p>\n<pre class=\"lang:default decode:true\">public function getAllOptions($withEmpty = true, $defaultValues = false)<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading on of my clients environment from PHP7 to PHP 7.2, the client reported not being able to open any customers in the admin dashboard. The logs showed the following error: PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on line 34 To fix [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-432","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 1.x Error on PHP 7.2 - Kevin Goedecke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 1.x Error on PHP 7.2 - Kevin Goedecke\" \/>\n<meta property=\"og:description\" content=\"After upgrading on of my clients environment from PHP7 to PHP 7.2, the client reported not being able to open any customers in the admin dashboard. The logs showed the following error: PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on line 34 To fix [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Kevin Goedecke\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-06T01:06:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kevingoedecke.com\/og-image.png\" \/>\n<meta name=\"author\" content=\"Kevin Goedecke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kevin Goedecke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/\",\"name\":\"Magento 1.x Error on PHP 7.2 - Kevin Goedecke\",\"isPartOf\":{\"@id\":\"https:\/\/kevingoedecke.com\/#website\"},\"datePublished\":\"2018-11-06T01:06:22+00:00\",\"author\":{\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\"},\"breadcrumb\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kevingoedecke.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 1.x Error on PHP 7.2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kevingoedecke.com\/#website\",\"url\":\"https:\/\/kevingoedecke.com\/\",\"name\":\"Kevin Goedecke\",\"description\":\"Founder. Entrepreneur.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kevingoedecke.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\",\"name\":\"Kevin Goedecke\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 1.x Error on PHP 7.2 - Kevin Goedecke","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/","og_locale":"en_US","og_type":"article","og_title":"Magento 1.x Error on PHP 7.2 - Kevin Goedecke","og_description":"After upgrading on of my clients environment from PHP7 to PHP 7.2, the client reported not being able to open any customers in the admin dashboard. The logs showed the following error: PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on line 34 To fix [&hellip;]","og_url":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/","og_site_name":"Kevin Goedecke","article_published_time":"2018-11-06T01:06:22+00:00","og_image":[{"url":"https:\/\/kevingoedecke.com\/og-image.png","type":"","width":"","height":""}],"author":"Kevin Goedecke","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kevin Goedecke","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/","url":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/","name":"Magento 1.x Error on PHP 7.2 - Kevin Goedecke","isPartOf":{"@id":"https:\/\/kevingoedecke.com\/#website"},"datePublished":"2018-11-06T01:06:22+00:00","author":{"@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871"},"breadcrumb":{"@id":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kevingoedecke.com\/blog\/2018\/11\/06\/magento-1-x-error-on-php-7-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kevingoedecke.com\/"},{"@type":"ListItem","position":2,"name":"Magento 1.x Error on PHP 7.2"}]},{"@type":"WebSite","@id":"https:\/\/kevingoedecke.com\/#website","url":"https:\/\/kevingoedecke.com\/","name":"Kevin Goedecke","description":"Founder. Entrepreneur.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kevingoedecke.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871","name":"Kevin Goedecke","url":"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":4,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}