Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Unable to save entries in Disable Modules Output after upgrading to 1.7.0.1
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

I’ve found a problem in 1.7.0.1 (see bug Issue #27884, http://www.magentocommerce.com/bug-tracking/issue/?issue=13819).

After upgrading to this version from 1.7.0.0 I’m no longer able to save any changes in the Disable Modules Output page.

If you are having this problem please go to that bug report and add a comment saying that you have it as well (as Magento currently say they can’t reproduce it, meaning it won’t get fixed wink

The reported error message is:
Exception message: Notice: Trying to get property of non-object in /web/app/code/core/Mage/Adminhtml/Model/Config/Data.php on line 135

Chasing through the code, this is definitely a regression, they’ve changed the way the backend config model is retrieved in Mage_Adminhtml_Model_Config_Data

I don’t have a real fix for this but as an interim work around you can take the relevant snippet of code from the old version and create a local override.

So copy app/code/core/Mage/Adminhtml/Model/Config/Data.php to app/code/local/Mage/Adminhtml/Model/Config/Data.php
In the local copy change the code from line 119 as follows:
Buggy Code:

foreach ($groupData['fields'as $field => $fieldData{
                $fieldConfig 
$sections->descend($section '/groups/' $group '/fields/' $field);
                if (!
$fieldConfig && $clonedFields && isset($mappedFields[$field])) {
                    $fieldConfig 
$sections->descend($section '/groups/' $group '/fields/'
                        
$mappedFields[$field]);
                
}
                
if (!$fieldConfig{
                    $node 
$sections->xpath($section .'//' $group '[@type="group"]/fields/' $field);
                    if (
$node{
                        $fieldConfig 
$node[0];
                    
}
                }

                
/**
                 * Get field backend model
                 */
                
$backendClass $fieldConfig->backend_model;
                if (!
$backendClass{
                    $backendClass 
'core/config_data';
                
}

                
/** @var $dataObject Mage_Core_Model_Config_Data */
                
$dataObject Mage::getModel($backendClass);
                if (!
$dataObject instanceof Mage_Core_Model_Config_Data{
                    Mage
::throwException('Invalid config field backend model: '.$backendClass);
                
}

                $dataObject
                    
->setField($field)
                    ->
setGroups($groups)
                    ->
setGroupId($group)
                    ->
setStoreCode($store)
                    ->
setWebsiteCode($website)
                    ->
setScope($scope)
                    ->
setScopeId($scopeId)
                    ->
setFieldConfig($fieldConfig)
                    ->
setFieldsetData($fieldsetData)
                ;

Replace with the equivalent part from the 1.7.0.0 version:

foreach ($groupData['fields'as $field => $fieldData{
                
/**
                 * Get field backend model
                 */
                
$backendClass $sections->descend($section.'/groups/'.$group.'/fields/'.$field.'/backend_model');
                if (!
$backendClass && $clonedFields && isset($mappedFields[$field])) {
                    $backendClass 
$sections->descend($section.'/groups/'.$group.'/fields/'.$mappedFields[$field].'/backend_model');
                
}
                
if (!$backendClass{
                    $backendClass 
'core/config_data';
                
}

                $dataObject 
Mage::getModel($backendClass);
                if (!
$dataObject instanceof Mage_Core_Model_Config_Data{
                    Mage
::throwException('Invalid config field backend model: '.$backendClass);
                
}
                
/* @var $dataObject Mage_Core_Model_Config_Data */

                
$fieldConfig $sections->descend($section.'/groups/'.$group.'/fields/'.$field);
                if (!
$fieldConfig && $clonedFields && isset($mappedFields[$field])) {
                    $fieldConfig 
$sections->descend($section.'/groups/'.$group.'/fields/'.$mappedFields[$field]);
                
}
                        

                $dataObject
                    
->setField($field)
                    ->
setGroups($groups)
                    ->
setGroupId($group)
                    ->
setStoreCode($store)
                    ->
setWebsiteCode($website)
                    ->
setScope($scope)
                    ->
setScopeId($scopeId)
                    ->
setFieldConfig($fieldConfig)
                    ->
setFieldsetData($fieldsetData)
                ;
 
Magento Community Magento Community
Magento Community
Magento Community
 
rsskga
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-15
San Francisco
 

Awesome fix. Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

thanks rsskga - please add your vote to the bug report so they fix it grin
http://www.magentocommerce.com/bug-tracking/issue/?issue=13819

 
Magento Community Magento Community
Magento Community
Magento Community
 
husseycoding
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2010-06-18
UK
 

I have added to the bug report with the following information:

I think this has to be a database related problem as I was experiencing this error after upgrading from CE1.4x to 1.7.0.0 and then 1.7.0.1, At the stage of having upgraded to 1.7.0.0, I had not tested enabling/disabling modules, however I did after upgrading to 1.7.0.1 and it was consistently failing to save.

Rolling back to the 1.4x fileset under the upgraded database then allowed saving again without error, rolling forward to 1.7.0.0, save again suceeds, and finally forward again to 1.7.0.1 again suceeded where it hadn\’t before.  So it seems some database configuration got saved with either the 1.4x or 1.7.0.0 fileset under the upgraded database which then allowed saving under 1.7.0.1.

The final oddity is when deploying this to a live test environment (as opposed to my local development environment) sving hadn\’t been tested until 1.7.0.1 and failed here also, however it suddenly just started working without rolling back the fileset at all however I had saved a few things in admin between it not working, and working though I can\’t remember what exactly.

Finally, the error originates from line 135 in app/code/core/Mage/Adminhtml/Model/Config/Data.php:

$backendClass = $fieldConfig->backend_model;

The problem here is that the $fieldConfig variable does not get set in the lines shortly before it to an object, and thus the call to backend_model fails.  The strange thing is debugging this method shows everything to happen in exactly the same way both when the save fails, and when it suceeds (debugging under 1.7.0.1 in both cases), the only difference is the line above does not throw an exception when the save succeeds, but does when it fails so I can only assume something has changed with regards to exception handling between the two scenarios.

So not sure exactly what changed but it looks to be database related rather than a bug with the fileset.  Rather than regressing the 1.7.0.1 code, you might first want to try rolling back to the 1.7.0.0 fileset and try saving under that which will hopefully succeed, then with a bit of luck returning to 1.7.0.1 will have resolved the issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

Interesting, it may well be a db issue - but I\’ve just replicated this on a clean install of 1.7.0.2, so no DB upgrade at all involved.
Which suggests that if it comes from the db content the SQL setup scripts are where the bug lies

 
Magento Community Magento Community
Magento Community
Magento Community
 
yoann123
Jr. Member
 
Total Posts:  7
Joined:  2012-04-04
 

Hi Everybody !

I have also a problem with magento 1.7.0.2… I can’t save products on backend after upgrade 1.6.2 to 1.7.0.2.
I got everytime the 500 server error page here : MY_MAGENTO/catalog_product/save/id/6110/key/cdf813436142e45d4971fd5ea70a662b/

I can create a new one but if i edit it i got same error.

someone can help me please, my website is on production

Thank you and sorry for my bad english.

Yoann.

 
Magento Community Magento Community
Magento Community
Magento Community
 
akewmagento
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2011-06-12
 

@benz

already replace the code on core. but the error still there.

is there any other way to fix it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dltr_org
Sr. Member
 
Avatar
Total Posts:  167
Joined:  2008-09-12
rockdale, sydney, australia
 

I was having same issue today on Magento enterprise ver. 1.12.0.2

so replaced line 135 from - app\code\core\Mage\Adminhtml\Model\Config\Data.php

$backendClass $fieldConfig->backend_model;

to:

$backendClass false;
   if(
is_object($fieldConfig)){
      $backendClass 
$fieldConfig->backend_model;
   
}
//$backendClass = $fieldConfig->backend_model;

enabled/disabled modules as required and reverted back to old core, so, there is no issues on other sections of the site grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

One addition to this issue - it only seems to happen to me if MAGE_IS_DEVELOPER_MODE is enabled, I set this in my apache conf on my test servers so of course it hits any test site I work on!

If you turn that off in your .htaccess file (or comment it out in your index.php) it may well stop the issue from happening in production mode.

 
Magento Community Magento Community
Magento Community
Magento Community
 
quicksnap
Jr. Member
 
Total Posts:  4
Joined:  2012-08-09
 

This override seems to cause issues with Admin->Config->Payment Methods->Paypal. When attempting to save a Paypal payment method, all changes will be not saved, and no error will be thrown. I have not looked into why. Removing the code restores Paypal configuration ability to admin panel.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

Very true - it does stop the PayPal settings from saving for me as well.
Please check to see if using the 1.7 code with Developer Mode set to Off works for you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

Hey guys, I think the fix for this issue is here in this bug report #28248.  This will allow the payment method and shipping method settings save to work as well.

// app/code/core/Mage/Adminhtml/Model/Config/Data.php

unset( $backendClass ); // Add this line
if (isset($fieldConfig->backend_model)) {
$backendClass 
$fieldConfig->backend_model;
}
if (!isset($backendClass)) {
$backendClass 
'core/config_data';
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
afi13
Jr. Member
 
Total Posts:  16
Joined:  2012-09-26
 

After fix, when i flush magneto cache, modules will disabled, how fix that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

Hey @Monty22, I don’t think this issue is caused by a plug-in at all.  I think the bug report is accurate:
http://www.magentocommerce.com/bug-tracking/issue?issue=14217

 
Magento Community Magento Community
Magento Community
Magento Community
 
ajaypatel_aj
Jr. Member
 
Total Posts:  6
Joined:  2012-03-21
 

Troubleshooting

The error can be due to installation or activation of mcrypt be fixed. If there is an Ubuntu or Debian server, mcrypt installed with the following bash command (administrator rights required):

apt-get install php5-mcrypt

info:http://magento.xonu.de/fehlerbehebung/blank-page-speichern-paypal-einstellungen/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top