View Issue Details

IDProjectCategoryView StatusLast Update
0002176OXID eShop (all versions)4. ------ eShop Core -------public2012-12-10 13:42
Reporterdominik_ziegler Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.4.3 revision 30016 
Fixed in Version4.4.5 revision 31315 
Summary0002176: oxBase::exists() fails on custom primary key column names
DescriptionIn the method exists() you have the following SQL query:
$sSelect= "select oxid from {$this->getViewName()} where {$this->_sExistKey} = ".$oDB->quote($sOXID);

This query searches for "oxid" and not for the specific "exist key" which affects the check result (it is always false of course).

Please fix this query as soon as possible!
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

arvydas_vapsva

2010-10-26 13:38

reporter   ~0003632

In this case (seems like very custom case) you should create custom class (which extends oxbase/oxi18n object) or module if you need to extend some default object functionality for your object/table combination with correct "$this->_sExistKey" field definition.

dominik_ziegler

2010-10-26 13:44

reporter   ~0003633

Last edited: 2010-10-26 13:44

I don't get that.

I think the query could changed from

$sSelect= "select oxid from {$this->getViewName()} where {$this->_sExistKey} = ".$oDB->quote($sOXID);

to

$sSelect= "select {$this->_sExistKey} from {$this->getViewName()} where {$this->_sExistKey} = ".$oDB->quote($sOXID);

without any inconvenience?

arvydas_vapsva

2010-10-26 14:21

reporter   ~0003634

misunderstood, yes, you are right! Thnx!