Skip to content

Conversation

@sreichel
Copy link
Contributor

Fatal error: Uncaught Varien_Exception: Invalid method Mage_Tax_Model_Config_Price_Include::afterSave(Array ( ) )

Copilot AI review requested due to automatic review settings November 14, 2025 11:31
@sreichel sreichel added the bug label Nov 14, 2025
@github-actions github-actions bot added Component: Tax Relates to Mage_Tax phpstan labels Nov 14, 2025
Copilot finished reviewing on behalf of sreichel November 14, 2025 11:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a fatal error caused by calling a non-existent afterSave() method on the parent class Mage_Core_Model_Config_Data. The fix corrects the parent method call from parent::afterSave() to parent::_afterSave().

Key changes:

  • Updates the parent method call to use the correct protected method name _afterSave() instead of the non-existent public afterSave() method
  • Removes the corresponding PHPStan baseline entry for the undefined static method error

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/code/core/Mage/Tax/Model/Config/Price/Include.php Corrects parent method call from afterSave() to _afterSave()
.phpstan.dist.baseline.neon Removes PHPStan baseline entry for the now-fixed undefined method error

Comment on lines 15 to 19
public function afterSave()
{
parent::afterSave();
parent::_afterSave();
Mage::app()->cleanCache('checkout_quote');
}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method signature should be protected function _afterSave() instead of public function afterSave(). In the Magento lifecycle, _afterSave() is the protected hook method that gets called automatically during the save process. Other Config_Data subclasses (like Mage_Adminhtml_Model_System_Config_Backend_Cache) follow this pattern by overriding protected function _afterSave(). The current implementation creates a public method that won't be called by the framework's save lifecycle.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant