View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005216 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2013-06-19 16:03 | 2013-11-13 09:10 |
Reporter | ChrisMillar | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | duplicate | ||
Product Version | 4.5.11 revision 46050 | ||||
Summary | 0005216: incorrect date in oxinsert column in oxorderarticles | ||||
Description | in oxid 4.5.11 EE incorrect date is saved in oxinsert column in oxorderticles on order. cause: 1) oxorder->execute calls oxorder::_setOrderArticles which calls oxOrderArticles::copyThis($oProduct) oxOrderArticles::copyThis appears to copy oxarticle__oxinsert to oxorderarticle_oxinsert, which it should not do. oxorderarticle_oxinsert should be current date 2) date in oxarticle__oxinsert is in t.m.Y format when loaded with german locale but on save date needs to be in Y-m-t format. this happens because oxarticle::load() gets oxarticles__oxinsert with current locale $this->oxarticles__oxinsert = new oxField(oxUtilsDate::getInstance()->formatDBDate( $this->oxarticles__oxinsert->value)); when this information is copied to oxorderarticles it is not converted back to US format before save. therefore we get dates in the future, dates in the past... lots of strange stuff... I've included a fix for this bug as a module | ||||
Steps To Reproduce | Make an order with German locale MySql with US locale | ||||
Additional Information | fix as module: <?php /** * CM * fix for incorrect date in oxinsert column in oxorderarticles * * */ class soloxOrderArticle extends soloxOrderArticle_parent { public function save(){ //oxinsert should not be modified on update if(!$this->exists()){ $simpleDateFormat = oxLang::getInstance()->translateString( 'simpleDateFormat' ); $simpleDate = oxUtilsDate::getInstance()->formatDBDate( date($simpleDateFormat), true ); $this->oxorderarticles__oxinsert = new oxField( $simpleDate, oxField::T_RAW ); } $blRet = parent::save(); return $blRet; } } | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | 5.3 | ||||
Database Version | any | ||||
related to | 0000704 | resolved | rimvydas_paskevicius | OXINSERT is zero |
|
this bug appears to be related to issue 0000704 How exactly was this bug fixed way back when? There appears to be no change log for 4.1.0 revision 17976 as far as i can tell oxinsert values are correct in oxarticles but i don't really understand why. |
|
From quick look to code, currently fix is in method - copyThis() if ( $sFieldName == "oxorderarticles__oxinsert" ) { oxDb::getInstance()->convertDBDate( $this->$sFieldName, true ); } |