OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
865 stars 436 forks source link

Fatal error: Uncaught Error: Call to a member function addData() on null #3811

Closed ADDISON74 closed 7 months ago

ADDISON74 commented 7 months ago

OpenMage 20.3.0 Magento Sample Pack PHP 8.3 MAGE_IS_DEVELOPER_MODE=1

Steps to reproduce this issue

1 - Go to the Backend > System > Import / Export > Dataflow - Advanced Profiles 2 - Click on the [Add New Profile] button 3 - Fill in "New Profile" and "Action XML" then click the [Save and Continue Edit] button

You will get this error

Fatal error:  Uncaught Error: Call to a member function addData() on null in /var/www/html/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php:119
Stack trace:
#0 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(421): Mage_Adminhtml_System_Convert_ProfileController->editAction()
#1 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(255): Mage_Core_Controller_Varien_Action->dispatch()
#2 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(181): Mage_Core_Controller_Varien_Router_Standard->match()
#3 /var/www/html/app/code/core/Mage/Core/Model/App.php(358): Mage_Core_Controller_Varien_Front->dispatch()
#4 /var/www/html/app/Mage.php(760): Mage_Core_Model_App->run()
#5 /var/www/html/index.php(56): Mage::run()
#6 {main}
  thrown in /var/www/html/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php on line 119

This is the PHP file and the line:

/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php:119

kiatng commented 7 months ago

I cannot replicate this error.

Ref https://github.com/OpenMage/magento-lts/blob/c5b35aa9da03142873ddd22af7cca0ebcb077bd9/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php#L30-L53

which is called in https://github.com/OpenMage/magento-lts/blob/c5b35aa9da03142873ddd22af7cca0ebcb077bd9/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php#L108-L110

$profile cannot be null because of line 37 $profile = Mage::getModel('dataflow/profile');.

It must be something else for you to get

Fatal error: Uncaught Error: Call to a member function addData() on null

Is the dataflow module disabled or is it missing? Regardless, it is more probable that something is wrong with your particular instance rather than OpenMage.

ADDISON74 commented 7 months ago

This proves the error based on the configuration mentioned in the initial post

https://github.com/OpenMage/magento-lts/assets/8360474/4fc8b213-afbe-40ea-88ce-8f4cba549ca9