-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Zend.php #268
Update Zend.php #268
Conversation
I came across a bug with Payment methods and I'm guessing it might also come up elsewhere. I'm writing a test payment gateway for Sagepay form and in the <payment> declaration in the config.xml there was a spelling mistake in the payment code so that it didn't match up with the payment code declared in the Model eg Config.xml <sagepayformd> <group>sagepayform</group> <active>0</active> <model>JuicyMedia_Sagepayform_Model_Sagepayform</model> <title>Sagepayform</title> <allowspecific>0</allowspecific> </sagepayformd> And in the Model - class JuicyMedia_Sagepayform_Model_Sagepayform extends Mage_Payment_Model_Method_Abstract { protected $_code = 'sagepayform'; Because there was this spelling mistake it was creating an exception in /lib/Magento/Di/Zend.php This pull request therefore is a way of making sure that Magento error's out properly with an exception instead of a PHP fatal error message. This is only one specific use case but Im guessing there are other examples where this might occur.
Just come across another mistyped class name with exactly the same thing and I had missed out the Model in the class name so it was giving me a class not defined error. Should thefore add a class_exists too on to the check on $name to again make sure that Magento exceptions out gracefully. |
eg if ($name == "" || $name == false || class_exists($name) == false) { |
Just to clarify in the config.xml the payment code was sagepayformd and the model was sagepayform so it wasn't returning the model creating the PHP fatal error. There would be occasion when developers make mistakes in class namings and would cause Magento to error ungracefully in those instances. |
Hello mrploddy, |
Hello mrploddy, |
[Troll] Kpi build & bugfixes
[Firedrakes] Fix L2 MAGETWO-47215
[Okapis] GitHub PRs and Bug
#268) * LYNX-460: Bundle products does not show original price and the final price has no currency * LYNX-460: updated tests * LYNX-460: updated review point
I came across a bug with Payment methods and I'm guessing it might also come up elsewhere.
I'm writing a test payment gateway for Sagepay form and in the declaration in the config.xml there was a spelling mistake in the payment code so that it didn't match up with the payment code declared in the Model eg
Config.xml
sagepayform
0
JuicyMedia_Sagepayform_Model_Sagepayform
<title>Sagepayform</title>
0
And in the Model -
class JuicyMedia_Sagepayform_Model_Sagepayform extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'sagepayform';
Because there was this spelling mistake it was creating an exception in /lib/Magento/Di/Zend.php
This pull request therefore is a way of making sure that Magento error's out properly with an exception instead of a PHP fatal error message.
This is only one specific use case but Im guessing there are other examples where this might occur.