Git Product home page Git Product logo

inchoo_php7's Introduction

Deprecation notice

Magento released official PHP 7.2 patches for Magento 1 (September 2018), which means this extension is not needed anymore!!

Remove this module from your M1 store and use official patches.

More info:
https://inchoo.net/magento/magento-1-official-php-7-2-patches/

Patches:
https://magento.com/tech-resources/download#download2240

Big THANKS to all contributors for reporting issues, testing, submitting pull requests. Your input was invaluable since official patch is based on work started here ;)

Inchoo_PHP7

PHP 7 compatibility extension for Magento 1 core by Inchoo. Article with some tests and stats: http://inchoo.net/magento/its-alive/.

Read the Wiki! It contains a lot of great information and stuff you need to do or know about running M1 on PHP7.

Compatibility

3.0.0 RC

For Magento CE 1.9.3.* on PHP 7.0 and PHP 7.1 (recommended).

This version introduced PHP 7.1 and 7.2 fixes and solution for deprecated mcrypt. It works on PHP 7.2 but most testing was done for 7.1.

We don't support older Magento versions anymore. Consider upgrading Magento since new versions patched multiple PHP 7 related things.

2.x

For Magento CE 1.9.3.* on PHP 7.0.

This version removed most overwrites from v.1.x since Magento implemented fixes in 1.9.3 core. It was fully compatible with Magento EE 1.14.3.x on PHP 7.0.

1.x

For Magento CE 1.9.2.2 - 1.9.2.4 on PHP 7.0.
Note that this version is also needed for cores with SUPEE-8788 applied.

Magento Enterprise

Read EE Wiki and check EE branch.

We can't overwrite and publicly release some parts of EE due to copyright issues, but we're trying to be fully compatible and release what we can.

3rd party extensions

May be incompatible with PHP 7. We can't do anything about that. But their authors can.

License

MIT. (See LICENSE.txt).

Issues

Yes. (Of course.) See Issues tab. Issue reporting is welcome. Pull requests are welcome. (But read Wiki and existing code first.)

Installation

Just download ZIP of the latest release and copy files to appropriate locations.

For Composer install, it's available on Firegento: http://packages.firegento.com/ .

Remember to clear the cache.

Extension is backwards compatible with PHP. Tested by us on PHP 5.6 & 5.5. Users have reported it's working fine even on 5.3.3. Installing the extension before switching to PHP 7 is a good idea.

inchoo_php7's People

Contributors

benjamw avatar chelevich avatar danielsousa avatar durzel avatar empewe avatar ernsto avatar icurdinj avatar justinelst avatar pinguspepan avatar sergeygribachev avatar sprankhub avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inchoo_php7's Issues

Fix for incorrect sorting in the calculation of the discount

Hi,

First of all: thanks a lot for this module!

Now, I am a bit confused about the "Fix for incorrect sorting in the calculation of the discount" lines in config.xml. Actually, I don't really get what this has to do with PHP7 compatibility. It looks more like a fix that is not related to PHP7.

Could you please give a little explanation on this?
Thanks again.

May be incompatible Enterprise TargetRule

grep -rnPe '->\$.+\[.+\]\(.*\)' app/
app/code/core/Mage/Core/Model/Layout.php:555: $out .= $this->getBlock($callback[0])->$callback[1](); app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php:99: $data['filter_options'] = $this->$data['options_method'](); app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php:250: $data['filter_options'] = $this->$data['options_method'](); app/code/core/Mage/ImportExport/Model/Import/Uploader.php:135: $params['object']->$params['method']($filePath); app/code/core/Enterprise/TargetRule/Model/Resource/Index.php:315: $v = $this->$callback[0]($v, $callback[1]);

Magento connect manager error install

Hello support,

When I update or install a exstension I get the follow error.

CONNECT ERROR: Package community/symmetrics_trustedrating 0.2.6: requires PHP version >= 5.2.0 and <= 6.0.0 current is: 7.0.4-1byte1

Best regards,
Michel

One-Step-Checkout

hello Support,

I see that my one-step-checkout page is not working after I have update to PHP7 and install Inchoo.

Could someone help me?

Best regards,
Michel

Checkout totals sort order broken with 1.9.3 & PHP7

As described in these Stackoverflow posts, the sorting algorithm for the totals collector classes is broken - and it seems to only be a problem in combination with PHP7. The consequences of this is devastating for anything relating to a quote or order totals sum, especially when using third party modules for giftcard and or storecredit calculations on top of the core.

http://stackoverflow.com/questions/9194281/sort-algorithm-magento-checkout-totals-sorted-wrongly-causing-wrong-shipping-ta
http://magento.stackexchange.com/questions/92783/magento-grand-total-without-taxes-in-1-9-with-php7

There is a couple of suggested fixes in both threads, but what finally solved it for me was this patch to class "Mage_Core_Config_Base", http://stackoverflow.com/a/11954867/653721

--- app/code/core/Mage/Sales/Model/Config/Ordered.php   2012-08-14 14:19:50.306504947 +0200
+++ app/code/local/Mage/Sales/Model/Config/Ordered.php  2012-08-15 10:00:47.027003404 +0200
@@ -121,6 +121,78 @@
         return $totalConfig;
     }

+// [PATCHED CODE BEGIN]
+
+    /**
+     * Topological sort
+     *
+     * Copyright: http://www.calcatraz.com/blog/php-topological-sort-function-384
+     * And fix see comment on http://stackoverflow.com/questions/11953021/topological-sorting-in-php
+     *
+     * @param $nodeids Node Ids
+     * @param $edges Array of Edges. Each edge is specified as an array with two elements: The source and destination node of the edge
+     * @return array|null
+     */
+    function topological_sort($nodeids, $edges) {
+        $L = $S = $nodes = array();
+        foreach($nodeids as $id) {
+            $nodes[$id] = array('in'=>array(), 'out'=>array());
+            foreach($edges as $e) {
+                if ($id==$e[0]) { $nodes[$id]['out'][]=$e[1]; }
+                if ($id==$e[1]) { $nodes[$id]['in'][]=$e[0]; }
+            }
+        }
+        foreach ($nodes as $id=>$n) { if (empty($n['in'])) $S[]=$id; }
+        while ($id = array_shift($S)) {
+            if (!in_array($id, $L)) {
+                $L[] = $id;
+                foreach($nodes[$id]['out'] as $m) {
+                    $nodes[$m]['in'] = array_diff($nodes[$m]['in'], array($id));
+                    if (empty($nodes[$m]['in'])) { $S[] = $m; }
+                }
+                $nodes[$id]['out'] = array();
+            }
+        }
+        foreach($nodes as $n) {
+            if (!empty($n['in']) or !empty($n['out'])) {
+                return null; // not sortable as graph is cyclic
+            }
+        }
+        return $L;
+    }
+
+    /**
+     * Sort config array
+     *
+     * public to be easily accessable by test
+     *
+     * @param $configArray
+     * @return array
+     */
+    public function _topSortConfigArray($configArray)
+    {
+        $nodes = array_keys($configArray);
+        $edges = array();
+
+        foreach ($configArray as $code => $data) {
+            $_code = $data['_code'];
+            if (!isset($configArray[$_code])) continue;
+            foreach ($data['before'] as $beforeCode) {
+                if (!isset($configArray[$beforeCode])) continue;
+                $edges[] = array($_code, $beforeCode);
+            }
+
+            foreach ($data['after'] as $afterCode) {
+                if (!isset($configArray[$afterCode])) continue;
+                $edges[] = array($afterCode, $_code);
+            }
+        }
+        return $this->topological_sort($nodes, $edges);
+    }
+
+// [PATCHED CODE END]
+
+
     /**
      * Aggregate before/after information from all items and sort totals based on this data
      *
@@ -138,38 +210,16 @@
         // invoke simple sorting if the first element contains the "sort_order" key
         reset($configArray);
         $element = current($configArray);
+        // [PATCHED CODE BEGIN]
         if (isset($element['sort_order'])) {
             uasort($configArray, array($this, '_compareSortOrder'));
+            $sortedCollectors = array_keys($configArray);
+
         } else {
-            foreach ($configArray as $code => $data) {
-                foreach ($data['before'] as $beforeCode) {
-                    if (!isset($configArray[$beforeCode])) {
-                        continue;
-                    }
-                    $configArray[$code]['before'] = array_unique(array_merge(
-                        $configArray[$code]['before'], $configArray[$beforeCode]['before']
-                    ));
-                    $configArray[$beforeCode]['after'] = array_merge(
-                        $configArray[$beforeCode]['after'], array($code), $data['after']
-                    );
-                    $configArray[$beforeCode]['after'] = array_unique($configArray[$beforeCode]['after']);
-                }
-                foreach ($data['after'] as $afterCode) {
-                    if (!isset($configArray[$afterCode])) {
-                        continue;
-                    }
-                    $configArray[$code]['after'] = array_unique(array_merge(
-                        $configArray[$code]['after'], $configArray[$afterCode]['after']
-                    ));
-                    $configArray[$afterCode]['before'] = array_merge(
-                        $configArray[$afterCode]['before'], array($code), $data['before']
-                    );
-                    $configArray[$afterCode]['before'] = array_unique($configArray[$afterCode]['before']);
-                }
-            }
-            uasort($configArray, array($this, '_compareTotals'));
+            $sortedCollectors = $this->_topSortConfigArray($configArray);
         }
-        $sortedCollectors = array_keys($configArray);
+        // [PATCHED CODE END]
+
         if (Mage::app()->useCache('config')) {
             Mage::app()->saveCache(serialize($sortedCollectors), $this->_collectorsCacheKey, array(
                     Mage_Core_Model_Config::CACHE_TAG
@@ -196,27 +246,6 @@
     }

     /**
-     * Callback that uses after/before for comparison
-     *
-     * @param   array $a
-     * @param   array $b
-     * @return  int
-     */
-    protected function _compareTotals($a, $b)
-    {
-        $aCode = $a['_code'];
-        $bCode = $b['_code'];
-        if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) {
-            $res = -1;
-        } elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) {
-            $res = 1;
-        } else {
-            $res = 0;
-        }
-        return $res;
-    }
-
-    /**
      * Callback that uses sort_order for comparison
      *
      * @param array $a

ERR (3): exception 'Zend_Exception' with message 'dbModel read resource does not implement Zend_Db_Adapter_Abstract'

2016-03-10T19:27:14+00:00 ERR (3):
exception 'Zend_Exception' with message 'dbModel read resource does not implement Zend_Db_Adapter_Abstract' in /lib/Varien/Data/Collection/Db.php:187
Stack trace:
#0 /app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Varien_Data_Collection_Db->setConnection(false)
#1 /app/code/local/Mage/Core/Model/Config.php(1351): Mage_Core_Model_Resource_Db_Collection_Abstract->construct(Array)
#2 /app/code/local/Mage/Core/Model/Config.php(1383): Mage_Core_Model_Config->getModelInstance('wordpress_resou...', Array)
#3 /app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('wordpress/post
...', Array)
#4 /app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Posts.php(75): Mage::getResourceModel('wordpress/post
...')
#5 /app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Posts.php(36): Fishpig_Wordpress_Block_Sidebar_Widget_Posts->_getPostCollection()
#6 /app/code/core/Mage/Core/Block/Abstract.php(918): Fishpig_Wordpress_Block_Sidebar_Widget_Posts->_beforeToHtml()
#7 /app/code/core/Mage/Core/Model/Email/Template/Filter.php(208): Mage_Core_Block_Abstract->toHtml()
#8 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#9 /lib/Varien/Filter/Template.php(163): call_user_func(Array, Array)
#10 /app/code/core/Mage/Core/Model/Email/Template/Filter.php(560): Varien_Filter_Template->filter('<h2 class="filt...')
#11 /app/code/core/Mage/Cms/Block/Page.php(101): Mage_Core_Model_Email_Template_Filter->filter('<h2 class="filt...')
#12 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Cms_Block_Page->_toHtml()
#13 /app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#14 /app/code/core/Mage/Core/Block/Abstract.php(577): Mage_Core_Block_Abstract->_getChildHtml('cms_page', true)
#15 /app/code/core/Mage/Page/Block/Html/Wrapper.php(52): Mage_Core_Block_Abstract->getChildHtml('', true, true)
#16 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Page_Block_Html_Wrapper->_toHtml()
#17 /app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#18 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#19 /app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#20 /app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#21 /app/design/frontend/smartwave/porto/template/page/1column.phtml(59): Mage_Core_Block_Abstract->getChildHtml('content')
#22 /app/code/core/Mage/Core/Block/Template.php(241): include('/XXX')
#23 /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/XXX...')
#24 /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#25 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#26 /app/code/local/Mage/Core/Model/Layout.php(557): Mage_Core_Block_Abstract->toHtml()
#27 /app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#28 /app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#29 /app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'XXX')
#30 /app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'XXX')
#31 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#32 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#33 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#34 /app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#35 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#36 /index.php(84): Mage::run('...', 'store')

500 response code & Array to String conversion error

I installed this on my local dev environment and things worked well. I just attempted to get this going on a remote server more similar to our production environment and when trying to load any Magento URLs (homepage & admin tested) I get a 500 error and in the system.log this is the only error I'm seeing:

2016-09-01T17:55:57+00:00 ERR (3): Notice: Array to string conversion in /...app/code/core/Mage/Core/Model/Layout.php on line 555

I can echo/exit on the index.php file so that is loading.

I used composer to install both on local and on the remote server.

Better fix Varien File Uploader in local folder the over Mage

This extensions fix the Uploader.php File in the Local Mage Folder. But the better way is to create a Varien File Folder inside local an fix the bug inside this folder.

$params['object']->{$params['method']}($this->_file['tmp_name']);

Some Extension will use the Varien File and not the Mage file.

Can't view orders in back-end

Magento EE v1.14.2.4, PHP 7

Hi we have the PHP7 Inchoo extension installed, and when we click to view a customer's orders in the back-end we get the following error.

We have contacted Magento support, but because the error references 'Inchoo_PHP7_Model_Layout', they are just telling us to uninstall the plugin and downgrade to PHP5.6 :-/

Can anyone offer any advice or a possible fix?

Thank you!

"
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.entity_id' in 'field list', query was: SELECT COUNT() FROM (SELECT main_table.entity_id, main_table.increment_id, main_table.customer_id, main_table.created_at, main_table.grand_total, main_table.order_currency_code, main_table.store_id, main_table.billing_name, main_table.shipping_name, shell_request. FROM (SELECT main_table., GROUP_CONCAT(name SEPARATOR '\n') AS name FROM sales_flat_order_grid AS main_table
LEFT JOIN sales_flat_order_item AS order_item ON order_item.order_id = main_table.entity_id WHERE (order_item.parent_item_id IS NULL) GROUP BY main_table.entity_id) AS shell_request WHERE (main_table.customer_id = '22') UNION ALL SELECT main_table.entity_id, main_table.increment_id, main_table.customer_id, main_table.created_at, main_table.grand_total, main_table.order_currency_code, main_table.store_id, main_table.billing_name, main_table.shipping_name, shell_request.
FROM enterprise_sales_order_grid_archive AS main_table WHERE (main_table.customer_id = '22')) AS a
#0 /ssddata/www/www.hayley.co.uk/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /ssddata/www/www.hayley.co.uk/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /ssddata/www/www.hayley.co.uk/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /ssddata/www/www.hayley.co.uk/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT COUNT()...', Array)
#4 /ssddata/www/www.hayley.co.uk/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT COUNT(
)...', Array)
#5 /ssddata/www/www.hayley.co.uk/lib/Zend/Db/Adapter/Abstract.php(828): Varien_Db_Adapter_Pdo_Mysql->query('SELECT COUNT(*)...', Array)
#6 /ssddata/www/www.hayley.co.uk/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#7 /ssddata/www/www.hayley.co.uk/lib/Varien/Data/Collection.php(225): Varien_Data_Collection_Db->getSize()
#8 /ssddata/www/www.hayley.co.uk/lib/Varien/Data/Collection.php(211): Varien_Data_Collection->getLastPageNumber()
#9 /ssddata/www/www.hayley.co.uk/lib/Varien/Data/Collection/Db.php(522): Varien_Data_Collection->getCurPage()
#10 /ssddata/www/www.hayley.co.uk/lib/Varien/Data/Collection/Db.php(569): Varien_Data_Collection_Db->_renderLimit()
#11 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(533): Varien_Data_Collection_Db->load()
#12 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php(61): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#13 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(626): Mage_Adminhtml_Block_Customer_Edit_Tab_Orders->_prepareCollection()
#14 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(632): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#15 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#16 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#17 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#18 /ssddata/www/www.hayley.co.uk/app/code/local/Inchoo/PHP7/Model/Layout.php(15): Mage_Core_Block_Abstract->toHtml()
#19 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Inchoo_PHP7_Model_Layout->getOutput()
#20 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(437): Mage_Core_Controller_Varien_Action->renderLayout()
#21 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_CustomerController->ordersAction()
#22 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('orders')
#23 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#24 /ssddata/www/www.hayley.co.uk/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#25 /ssddata/www/www.hayley.co.uk/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#26 /ssddata/www/www.hayley.co.uk/index.php(82): Mage::run('', 'store')
#27 {main}

"

Not compatible with PIMGento?

Installing this extension destroyed my PIMGento setup. What do I need to change in Inchoo PHP 7 to make it compatible with their connector for Akeneo?

Json decoding error

PHP 7 throws an exception when trying to decode an empty json string, this can result in errors in checkout and customer panel, when trying to save data, see here:
stackoverflow post and magento.stackexchange post.

Apparently it happens in Mage_Persistent_Model_Session in _beforeSave() $this->getData() is empty so $info is empty and decoding fails (taken from stackexchange post). A solution would be to pass "{}" instead of "".

PHP7 incompatibility - several uses of &new in /lib

Hi,

When trying to compile all of the PHP files under Magento using OpCache I ran into some issues, namely that there are several places under /lib where the result of a new statement is assigned to a variable by reference. This was depreciated in PHP 5.6 and is now a parsing error in 7.x, and blocks compilation.

http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.other.new-by-ref

Affected files (Magento CE 1.9.2.2):

lib/PEAR/XML/Unserializer.php:260: * $unserializer = &new XML_Unserializer();
lib/PEAR/XML/Unserializer.php:801:                $value['value'] = &new $classname;
lib/PEAR/XML/Unserializer.php:974:        $this->_parser = &new XML_Parser($this->
lib/PEAR/XML/Parser/Simple.php:82: * $p = &new myParser();
lib/PEAR/XML/Parser.php:616:        $err = &new XML_Parser_Error($msg, $ecode);
lib/PEAR/HTTP/Request.php:110: * $a = &new HTTP_Request('http://www.yahoo.com/');
lib/Varien/Pear/Registry.php:49:                    $this->_config = &new PEAR_Config($this->statedir . DIRECTORY_SEPARATOR .

There is nothing under /app that is uses &new - so that's safe.

I was going to submit a pull request for this, but since it affects core files that can't be extended (without some trickery) I thought best to simply post this issue so people will be aware.

SOAP API error?

Hi All,

One of my clients uses 'carrytheone' to connect to the Kashflow SaaS app - this is all done via the Magento API. Tonight we attempted to switch over to PHP7 - 'carrytheone' reported that Magento returned and error - Procedure 'login' not present - it didn't provide a stack trace.

This only happened after changeover so seems to be potentially something in the API code not sitting well with PHP7?

Naturally, switched the client back to an older PHP for now.
Mark.

check against latest summary of compatibility issues

just a tiny help to bring things together:
this seems to be a good continuously refreshed summary of incompatibilities:
https://magento.stackexchange.com/questions/74008/is-magento-ready-for-php-7/

=> would be good to see all discussed points to be addressed within this extension
and of course one could point from there to this repository...

another compatibility fix is worked on here:
=> https://github.com/MageMechanic/PhpSeven

maybe one can benefit from each-other...

EE branch update?

Hi,

Are you going to update the EE branch with the 1.14.3 changes?

Also what are the differences between EE and CE in terms of the branches?

API: Argument product should be productId

We encouter some problems with the Magento API after we switched from Magento CE 1.7.0.2 (HHVM) to CE 1.9.2.4 (PHP7 and this extension) with argument 'product'.
The problem is in the argument 'product', it should be 'productId'. When we replace 'product' with 'productId' in the request, it returns the correct result.
I can't believe that this argument has changed in Magento. Is it?
I see a overwrite class catalog/product_link_api_v2.
Can you help me debug and fix this?

Any suggestions for PHP Fatal error: Uncaught Error: Function name must be a string...

Hello
I'm getting this error when I upgrade to PHP7.
I've installed the inchoo_PHP7 module and updated .htaccess with mod_php settings as per the readme,
If anyone has any suggestions it would be much appreciated.
Thanks in advance

PHP Fatal error: Uncaught Error: Function name must be a string in /var/www/html/mydomain.com/app/code/core/Mage/Core/Model/Layout.php:555\nStack trace:\n#0 /var/www/html/mydomain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()\n#1 /var/www/html/mydomain.com/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()\n#2 /var/www/html/mydomain.com/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')\n#3 /var/www/html/mydomain.com/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')\n#4 /var/www/html/mydomain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()\n#5 /var/www/html/mydomain.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')\n#6 /var/www/html/mydomain.com/app/code/cor in /var/www/html/mydomain.com/app/code/core/Mage/Core/Model/Layout.php on line 555

Redis sessions

Just so it's documented here: Redis sessions probably crash.
We now have a pretty good idea how to fix this (the same as db sessions), and will get around to it as soon as we have a Redis environment to test that.
Meanwhile, if someone else already did this, pull requests are always welcome.

Typo in Session.php?

Hello,

I am a noob at coding etc, but in the Session.php file contained in the fix pack, on line 40:
const SEESION_MAX_COOKIE_LIFETIME = 3155692600;

Is "SEESION_MAX_COOKIE_LIFETIME" spelt incorrectly on purpose, or is this a bug?

Thank you!

Error add image to product

Hello Support,

When I turn on PHP7 on the server Magento 1.9.2.1. I cannot upload a new image to the product.
When I click on upload files I get a error in the backend!

best regards,
Michel

Not valid template file

2016-05-23T21:29:28+00:00 CRIT (2): Not valid template file:frontend/base/default/template/payment/info/pdf/default.phtml

Only header after PHP7 - Magento 1.9.24

Hi,

I uploaded the content of the ZIP by FTP. We use Easyapache4. I changed to PHP7 but the main part of the frontend has disappeared.
I don't know how to use modman or how to verify if the script works properly or not.
Should I see an enable option in backend?
I cleared cache as well but nothing happened.

Here is my error log but Im not sure if it is related to this script:

Stack trace: #0 /home/public_html/lib/Zend/Locale/Format.php(1162): Zend_Locale_Format::_parseDate('2013-01-14 10:1...', Array) #1 /home/public_html/app/code/core/Zend/Date.php(2646): Zend_Locale_Format::getDate('2013-01-14 10:1...', Array) #2 /home/public_html/steelplatecutting/app/code/core/Zend/Date.php(1091): Zend_Date->_calculate('set', '2013-01-14 10:1...', 'yyyy-MM-dd HH:m...', 'en_GB') #3 /home/public_html/steelplatecutting/app/code/core/Zend/Date.php(210): Zend_Date->set('2013-01-14 10:1...', 'yyyy-MM-dd HH:m...', 'en_GB') #4 /home/public_html/steelplatecutting/app/code/core/Mage/Core/Model/Locale.php(546): Zend_Date->__construct('2013-01-14 10:1...', 'yyyy-MM-dd HH:m...', Object(Zend_Locale)) #5 /home/public_html/steelplatecutting/app/code/core/Mage/Eav/Model/Entity/Attribute/ in /home/public_html/steelplatecutting/lib/Zend/Locale/Format.php on line 827

Abstract.php errors, can't get Magento 1.9.2.4 working with php7

Hi I hope you can please help. My site just has the white screen of death both on the backend and frontend...

I get these errors in Apache after applying your patch to try get the site to work:

mod_fcgid: stderr: Stack trace: mod_fcgid: stderr: #0 /home/public_html/app/code/core/Mage/Core/Block/Messages.php(80): Mage_Core_Model_Session_Abstract->getMessages(true) mod_fcgid: stderr: #1 /home/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Core_Block_Messages->_prepareLayout() mod_fcgid: stderr: #2 /home/public_html/app/code/local/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Inchoo_PHP7_Model_Layout)) mod_fcgid: stderr: #3 /home/public_html/app/code/local/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('core/messages', 'messages') mod_fcgid: stderr: #4 /home/public_html/app/code/local/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('core/messages', 'messages') mod_fcgid: stderr: #5 /home/public_html/app/code/local/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_El in /home/public_html/app/code/core/Mage/Core/Model/Session/Abstract.php on line 214

Any help really appreciated thanks :)

Installed patch, but unable to log into magento admin backend

Hello,

So I installed the patch. I can access the magento site front end now, and the backend, but I can't log in to the backend (most likely not in the front end either). Here is the error message I am getting when I try to log in to admin:

Invalid Form Key. Please refresh the page.

Here is the error message in the magento system.log:

2016-03-03T04:22:59+00:00 ERR (3): Warning: session_module_name(): Cannot find named PHP session module (memcache) in /var/www/www.proproductssales.com/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 81
2016-03-03T04:22:59+00:00 ERR (3): Warning: session_start(): open(tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10/sess_2rvk3rvc73tp9pkdvkpecut234, O_RDWR) failed: No such file or directory (2) in /var/www/www.proproductssales.com/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133

Please be advised that there currently does not seem to be a php 7 memcache installation via yum available. Does that mean that for now I have to revert back to PHP 5? Or is there another work around I can try. From what I saw the front end of Magento seems to be rocking fast with PHP 7

Please advise.

Thanks,

Martin

Patch contribution

Hello

I'm just wondering if you guys tried to contribute patch to Magento to get official support of PHP7 for M1?

Thanks

Json Decoding Failed - inchoo php7 1.06

Hello,

I have installed an extension that is not working with inchoo php7. I'm using 1.06. And Magento 1.9.2.4

What I have done to make it work:

  • installing inchoo 1.06 mod manually
  • testing change to core:

$out .= $this->getBlock($callback[0])->$callback[1]();

to

$this->getBlock($callback[0])->{$callback[1]}();

I can open the extension, though when I want to add a new profile I see the following error:

a:5:{i:0;s:29:"Decoding failed: Syntax error";i:1;s:2981:"#0 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Helper/Data.php(659): Zend_Json::decode('', 1) #1 /home/usr/domains/dmn.com/public_html/app/code/local/EcommerceTeam/Dataflow/Model/Profile/Import.php(164): Mage_Core_Helper_Data->jsonDecode(NULL) #2 /home/usr/domains/dmn.com/public_html/app/code/local/EcommerceTeam/Dataflow/Block/Adminhtml/Profile/Import/Edit/Tab/Mapping.php(33): EcommerceTeam_Dataflow_Model_Profile_Import->getMapping() #3 /home/usr/domains/dmn.com/public_html/app/design/adminhtml/default/default/template/ecommerceteam/dataflow/import/profile/edit/mapping.phtml(12): EcommerceTeam_Dataflow_Block_Adminhtml_Profile_Import_Edit_Tab_Mapping->getMapping() #4 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/usr/d...') #5 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...') #6 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() #7 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml() #8 /home/usr/domains/dmn.com/public_html/app/code/local/EcommerceTeam/Dataflow/Block/Adminhtml/Profile/Import/Edit/Tabs.php(39): Mage_Core_Block_Abstract->toHtml() #9 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): EcommerceTeam_Dataflow_Block_Adminhtml_Profile_Import_Edit_Tabs->_prepareLayout() #10 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Inchoo_PHP7_Model_Layout)) #11 /home/usr/domains/dmn.com/public_html/app/code/local/EcommerceTeam/Dataflow/controllers/Adminhtml/Dataflow/Profile/ImportController.php(70): Mage_Core_Model_Layout->createBlock('ecommerceteam_d...') #12 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): EcommerceTeam_Dataflow_Adminhtml_Dataflow_Profile_ImportController->editAction() #13 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit') #14 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #15 /home/usr/domains/dmn.com/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch() #16 /home/usr/domains/dmn.com/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array) #17 /home/usr/domains/dmn.com/public_html/index.php(83): Mage::run('', 'store') #18 {main}";s:3:"url";s:86:"/index.php/beheercdm/dataflow_profile_import/new/key/1b10fb9f764885a4d3d86fefe910a693/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Anyone get an idea how to fix this? (p.s. I also have mailed the guys from the extension, waiting for repley).

Thanks in advance,

HRR

API bug in 1.9.3 with PHP7

As per this StackOverflow post, the new 1.9.3 version (only?) have a problem with the XML RPC response and PHP7 support:

http://magento.stackexchange.com/questions/140761/soap-connection-problems-after-1-9-3-0-update

The fix being to patch
Mage_Api_Model_Server_Handler_Abstract::processingMethodResult(array $result)

To look like this instead

public function processingMethodResult($result)
{
    if (is_array($result)) {
        foreach ($result as &$row) {
            if (!is_null($row) && !is_bool($row) && !is_numeric($row)) {
                if (is_array($row)) {
                    $row = $this->processingMethodResult($row);
                } else {
                    $row = $this->processingRow($row);
                }
            }
        }
    } else {
        if (!is_null($result) && !is_bool($result) && !is_numeric($result)) {
            $result = $this->processingRow($result);
        }
    }
    return $result;
}

Hopefully this will save someone a few hours. ;)

Wrong totals calculation on cart page

With @danslo's HHVM totals fix, I get a wrong totals calculation in the cart view in our Magento 1.9.2.4. More precisely said: The grand total has too times the VAT and/or the shipping cost.

When I remove the following code from config.cml, I get the correct grand totals calculation back in the cart view:

        <!-- Fix for incorrect sorting in the calculation of the discount -->
        <sales>
            <quote>
                <totals>
                    <msrp>
                        <before>grand_total</before>
                    </msrp>
                    <shipping>
                        <after>subtotal,freeshipping,tax_subtotal,msrp</after>
                    </shipping>
                </totals>
            </quote>
        </sales>

This faulty calculation might also occur due to our own number of third party extension we already installed. I haven't tested it on an otherwise blank Magento. But as the calculation has no problems without that code, I assume it's buggy.

The original author of the fix says on https://github.com/danslo/Rubic_FixTotalSorting :

This bug has been solved, and proper behavior can be enabled by passing -vEval.EnableZendSorting=1 to HHVM. This module is no longer necessary and only exists for historical purposes.

Syntax error when updating attributes

Hi guys,

we have PHP7 up and running in our shop. Now we came across a problem, we cannot edit our attributes. We came across this problem when adding a new brand in our 'manufacturer' attributes.

We get this error: Decoding failed: Syntax error

What to do?

Add composer.json

Please add composer.json and publish to packages.firegento.com. This will very helpful.

Tags are a mess

Hi,

The tags are a mess. There now is a 1.0.3 and a 1.0.3-CE tag, as well as other versionings.

Could you remove all non-semver tags? I think 1.0.3 is the most recent correct one.

When I add ^1.0.0 to my composer.json, it'll now fetch '1.0.3', which is correct. But 1.0.3-CE doesn't make sense.

PHP7 - Syntax error Unexpected Token

Hello,

I dont know if I can ask this question here, so just tell if I should delete.

After upgrading to php7, I have started getting javascript errors as:
Uncaught SyntaxError: Unexpected token < in JSON at position 0
and
Uncaught SyntaxError: Unexpected token }

Affected onestepcheckouts buttons on page and my "add review" in magneto.

Anyone had issues like this, any changes in php7 I should know of?

Thank you in advance,

.htaccess <IfModule> issue

Minor thing this, only noticed it today. The .htaccess that ships with Magento 1.x includes a set of PHP settings that will be ignored by an install running PHP 7.x.

This is because they are contained within an <IfModule mod_php5.c> declaration.

The simple fix for this is to change it to <IfModule mod_php7.c>. Assuming no other incompatible changes have been made to the content of this block, there are no issues.

This is fairly important because one of the things added in this block by default is:

php_value memory_limit 256M
php_value max_execution_time 18000

..which will be ignored without this change.

Do you think this is important enough to be included in this modul

Session issue in database PHP7

There is a issue with sessions.
This only happens when you set "session_save" in "local.xml" to "db".
If you try with the option "files" there are no problems.

Error.
Recoverable Error: session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions) in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 492

Product Attribute not save, show error.

Hi Team,

after upgrading PHP version to PHP 7, in our current project we got lots of error and by installing Inchoo_PHP7 extension fixed almost all error but still we get error while saving product attribute as "Decoding failed: Syntax error".

Please guide us to fix issue.

Thank you in advance.

Magento 1.9.2.4 and php 7.0.6

Hi. despite those fixes, I'm unable to login into admin area with PHP 7.0.6
with php 7.0.0 and 7.0.1 it works.
I use SSL

Incorrect rewrite for Enterprise_TargetRule_Model_Resource_Index

Hi all,

We're about to migrate our store to PHP7 and I've been testing it with the Inchoo patch installed (great job btw!), and noticed this in the system.log file:

ERR (3): Notice: Array to string conversion  in /{server_path}/app/code/core/Enterprise/TargetRule/Model/Resource/Index.php on line 315
ERR (3): Notice: Undefined property: Enterprise_TargetRule_Model_Resource_Index::$Array  in /{server_path}/app/code/core/Enterprise/TargetRule/Model/Resource/Index.php on line 315

which is supposed to be fixed by rewriting the above class to Inchoo_PHP7_Model_Resource_Index.

After using Xdebug to dig into it, it seems that the rewrite XML specified in this module's config.xml is incorrect, and the resource model class Enterprise_TargetRule_Model_Resource_Index is still being instantiated.

I believe the rewrite should actually be:

<enterprise_targetrule_resource>
    <rewrite>
        <index>Inchoo_PHP7_Model_Resource_Index</index>
    </rewrite>
</enterprise_targetrule_resource>

I've tested this change and it loads Inchoo_PHP7_Model_Resource_Index correctly, which fixes the issue. I'll also file a pull request with a fix.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.