AOEpeople / mpmd

Magento Project Mess Detector (for n98-magerun)
180 stars 25 forks source link

Inverted diff when overriding code in local codepool? #4

Open real34 opened 9 years ago

real34 commented 9 years ago

It seems that diff is inverted in the Code Pool Override Report (- instead of +). I wanted to check whether it was a bug or a feature and if you think it should be fixed I'll work on a patch.

To reproduce

The "Changed files (differentFileContent)" of the "Comparing local and core" section contains the following diff for /Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php:

--- /path/to/app/code/local/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php   2012-01-20 00:00:00.000000000 +0100
+++ /path/to/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php    2012-01-09 00:00:00.000000000 +0100
@@ -159,7 +159,7 @@
             'required' => true,
         ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/actions'));

-        //Mage::dispatchEvent('adminhtml_block_salesrule_actions_prepareform', array('form' => $form));
+        Mage::dispatchEvent('adminhtml_block_salesrule_actions_prepareform', array('form' => $form));

         $form->setValues($model->getData());

Expected

For more consistency with Core Hacks Report, the diff should read:

--- /path/to/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php    2012-01-09 00:00:00.000000000 +0100
+++ /path/to/app/code/local/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php   2012-01-20 00:00:00.000000000 +0100
@@ -159,7 +159,7 @@
             'required' => true,
         ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/actions'));

-        Mage::dispatchEvent('adminhtml_block_salesrule_actions_prepareform', array('form' => $form)); 
+        //Mage::dispatchEvent('adminhtml_block_salesrule_actions_prepareform', array('form' => $form));

         $form->setValues($model->getData());

What do you think?

real34 commented 9 years ago

Any thoughts?

schmengler commented 9 years ago

+1 this confused me as well

tmotyl commented 8 years ago

Hi @real34, can you provide a pull request fixing this issue?

hannes011 commented 8 years ago

+1