104

This can happen if your sub-class added new dependencies after the existing optional dependencies of the parent class. Snippet from the parent \Magento\Quote\Model\Cart\CurrencyFactory $currencyFactory, // required JoinProcessorInterface $extensionAttributesJoinProcessor, // required \Magento\Framework\Model\Resource\AbstractResource $...


72

It happens because in PHP 7 you need to clarify that you are going to call the $callback variable as a method (function). So, the original line of the code looks like the following (file app/code/core/Mage/Core/Model/Layout.php): $out .= $this->getBlock($callback[0])->$callback[1](); In order to make it work on the latest PHP version we need to ...


33

http://php.net/manual/de/migration70.incompatible.php https://wiki.php.net/rfc/uniform_variable_syntax Due to uniform variable syntax the code is now interpreted strictly from left to right. The line $params['object']->$params['method']($this->_file['tmp_name']); should be $params['object']->{$params['method']}($this->_file['tmp_name']); ...


33

Today I received the same-type error: PHP Fatal error: Cannot declare class Class\Name\Here , because the name is already in use in /var/www/m2/magento2/app/code/path/to/the/class.php on line 100 where the line 100 is end of the file. Approximately after 4 hours of debugging I really find the reason: a misprint in the namespace declaration. Till the ...


23

If you want to run your Magento 1.x website on PHP7, you need to make some little tweaks in your some Magento 1.x files to make it work without any issues. Most of Magento code is still valid in PHP 7, there are few incompatibilities listed below: 1. Uniform Variable Syntax issues: 1.1 app/code/core/Mage/Core/Model/Layout.php:555 This file causes and ...


23

Try following commands: php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento setup:di:compile php bin/magento cache:flush php bin/magento cache:clean //To run command forcefully php -f bin/magento //To run command with memory limit 4G php -d memory_limit=4G bin/magento //To run command with max memory limit php -d ...


19

Just need to clear comment before this line in php.ini file: ;extension=php_intl.dll to extension=php_intl.dll


18

You can still use xdebug in Magento 2, but it will require modifying the default max_nesting_level value of 100 that xdebug uses. Open up the php.ini file being used by your server and update or add the following config, depending on if it already exists in your file: xdebug.max_nesting_level = 200 This works for me, but if you still see the error you ...


16

Inject \Magento\Framework\Serialize\Serializer\Json class for serialize and unserialize values. protected $serialize; public function __construct( ... \Magento\Framework\Serialize\Serializer\Json $serialize, ... ) { $this->serialize = $serialize; } Now use $this->serialize $value = $this->serialize->unserialize($...


11

checkout_onepage_controller_success_action give you order id's by using $observer->getEvent()->getOrderIds(). This does not given order object directly so, you are getting the error Then you need to object by this id <?php namespace [VendorName]\[ModuleName]\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\App\...


10

We had the same issue after enabling FPC. The following error would occur: Fatal error: Uncaught Error: Call to a member function getIdentities() on null in /vendor/magento/module-catalog/Block/Category/View.php:177 Not the most helpful error message but after some digging we found that this was being triggered by using the block type Magento\Catalog\...


8

Make read/write permission for var directory. That means var directory should be 0777.


8

The following command will helps you. Please Run Upgrade Command: php bin/magento setup:upgrade


7

A more direct answer to this problem is: At the top of the file: {magento-base}/vendor/magento/data-migration-tool/tests/unit/testsuite/Migration/Step/UrlRewrite/Version11410to2000Test.php Replace: namespace Migration\Step; With: namespace Migration\Step\UrlRewrite;


6

Your problem is here: public function gridAction() { $this->loadLayout(); $this->getResponse()->setBody( $this->getLayout()->createBlock('foo_bar/adminhtml_foo_grid')->toHtml() ); } 'foo_bar/adminhtml_foo_grid' here foo_bar is your confix.xml block name adminhtml_foo_grid is the path of your Grid.php that ...


6

Hope this will help you You can try this in your CLI: php bin/magento setup:static-content:deploy


6

I found that in the LN module 2 different namespace declarations was used: Layerednavigation and LayeredNavigation. When code is compiled all di class arguments was stored in the array where the class name with namespace was used as key (string). The problem is in the autoloader: it can not find the files because array keys are case sensitive in the php and ...


5

It should be Mage_Catalog_Model_Product_Type and not Mage_Catalog_Model_Product_TYPE (note the capitalisation on the last word)


5

Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE (notice the capitalization, which was the source of your error) is a constant. Using a constant for values that won't change is preferred over writing "magic strings"1 all over the application. Why? no errors due to typos. If you misspell the string, chances are, you won't notice until much later. If you ...


5

You can add the following in index.php - make sure the log file path is correct function shutdownCapture() { global $lastQueryString; $error = error_get_last(); if ($error !== null && strpos($error['message'], 'Allowed memory size') !== false) { file_put_contents(MAGENTO_ROOT.'/var/log/oom.log', print_r(array($lastQueryString, $...


5

I just had the same and found out by debugging that there was an invalid rewrite for the layout model Mage_Core_Model_Layout. In fact, I had an incomplete install of Inchoo_PHP7 where the config.xml file was in place but the class Inchoo_PHP7_Model_Layout which was given as a rewrite was not. Thus, the solution was to add the full module Inchoo_PHP7 module (...


5

I know this is a pretty old question, but just in case someone came here (as I did)... You have to install the php-dom module on your system, on debianlike systems: apt-get install php-xml And restart your server: service apache2 restart


5

Install these 2 extention and restart apache sudo apt-get install php7.1-dom sudo apt-get install php7.1-xml sudo service apache2 restart Note: php version according to your current php version


5

you can change order status as below: $orderId = YOUR_ORDER_ID; $order = Mage::getModel('sales/order')->load($orderId); $orderIncrementId = YOUR_ORDER_INCREMENT_ID; $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId); /** * change order status to 'Completed' */ $order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, ...


5

As per magento 2.2 release note, Now you can not use direct serialize and unserialize PHP functions. To solve this issue Inject \Magento\Framework\Serialize\Serializer\Json class for serialize and unserialize values. public function __construct( ... \Magento\Framework\Serialize\Serializer\Json $serialize, ... ) { $this->serialize = $...


5

It seems you're using the Magento Compiler. You'll need to refresh or disable. In my case, I prefer to disable the Compiler. The easier way is using Magento shell. Go to the shell directory and then run: php compiler.php state Now you'll see the current status of or compiler. If is enabled and/or compiled then please execute these commands: php compiler....


4

Meanwhile I found out it's a bug introduced in 1.9.1. There are already two issues in Magento's bug tracking tool about this (you need a Magento Account to see them) http://www.magentocommerce.com/bug-tracking/issue/index/id/456 http://www.magentocommerce.com/bug-tracking/issue/index/id/567 While this does not solve my issue I know now it has nothing to do ...


4

If you look at the file to which magento points out, you can find the below line which comes inside dispatch method File : app/code/core/Mage/Core/Controller/Varien/Front.php $this->_getRequestRewriteController()->rewrite(); The error says rewrite() is calling on a non-object. This means that, $this->_getRequestRewriteController() provides you a ...


4

Check if the apiUser and apiKey are correct or maybe try to set a new key/password via System > Web-Services > SOAP/XML-RPC - Users. Disable WSDL Cache: Under System > Configuration > Magento Core API set Enable WSDL Cache to "No". Updated/debug your script: Try to run your script with the WSDL cache disabled settings: ini_set("soap.wsdl_cache_enabled", "0"...


Only top voted, non community-wiki answers of a minimum length are eligible