View Issue Details

IDProjectCategoryView StatusLast Update
0005063OXID eShop (all versions)4.07. Source code, Testpublic2013-04-16 12:58
Reporterspoofer Assigned To 
PrioritynormalSeveritymajorReproducibilityrandom
Status resolvedResolutionfixed 
Fixed in Version4.7.5 / 5.0.5 
Summary0005063: PHP Fatal error due to missing method check in application/models/oxorderarticle.php
DescriptionAfter updating to Enterprise Edition 5.0.3_54408 sometimes we get the following error:

PHP Fatal error: Call to a member function setValue() on a non-object in
application/models/oxorderarticle.php on line 645

Reason is the missing method check which was implemented before.

We used the following emergency patch to solve the problem (re-implementation of method_exists() call):

Index: application/models/oxorderarticle.php
===================================================================
diff -u -N -r58be538021119b4a1091f1b1836a47f471d71e11
-r79ce265c5a3cbfe26be35d12d883edafdce63257
--- application/models/oxorderarticle.php (.../oxorderarticle.php)
(revision 58be538021119b4a1091f1b1836a47f471d71e11)
+++ application/models/oxorderarticle.php (.../oxorderarticle.php)
(revision 79ce265c5a3cbfe26be35d12d883edafdce63257)
@@ -642,7 +642,11 @@
     {
         if ( $this->oxorderarticles__oxstorno->value == 0 ) {
             $myConfig = $this->getConfig();
- $this->oxorderarticles__oxstorno->setValue( 1 );
+ if(method_exists ($this->oxorderarticles__oxstorno, 'setValue')) {
+ $this->oxorderarticles__oxstorno->setValue( 1 );
+ } else {
+ $this->oxorderarticles__oxstorno->value = 1;
+ }
             if ( $this->save() ) {
                 $this->updateArticleStock(
$this->oxorderarticles__oxamount->value,
$myConfig->getConfigParam('blAllowNegativeStock') );
             }
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

tadas

2013-04-16 12:58

reporter   ~0008614

Changed value assignment so that it would not try to use a method that might not exist