View Issue Details

IDProjectCategoryView StatusLast Update
0000940OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2012-12-07 14:23
Reporterjuergen_busch Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.1.2 revision 18998 
Fixed in Version4.1.5 revision 21618 
Summary0000940: Bug in function oxrating::allowRating
DescriptionFunction oxrating::allowRating seems to delete not only the rating of one user. It seems to delete all ratings of all users when ratings are 'old enough' to fulfill the deleting criteria.
Additional InformationBug is reported by Frank Knapp, eSales International Inc. via Technical Support.
Customer: high-feelings.de

Because problem is difficult to descripe in detail here is a fix for it.
New: oxuserid = '$sUserId' and oxtype='$sType' and oxobjectid = '$sObjectId' in delete statement.



public function allowRating( $sUserId, $sType, $sObjectId)
    {
        $oDB = oxDb::getDb();
        $myConfig = $this->getConfig();
        if ( $iRatingLogsTimeout = $myConfig->getConfigParam( 'iRatingLogsTimeout' ) )
{
            $sExpDate = date( 'Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime() -
$iRatingLogsTimeout*24*60*60);
            $oDB->execute( "delete from oxratings where oxuserid = '$sUserId' and
oxtype='$sType' and oxobjectid = '$sObjectId' and oxtimestamp < '$sExpDate'" );
        }
        $sSelect = "select oxid from oxratings where oxuserid = '$sUserId' and
oxtype='$sType' and oxobjectid = '$sObjectId'";
        if ( $oDB->getOne( $sSelect ) ) {
            return false;
        } return true;
    }
TagsRatings, Reviews
Theme
BrowserAll
PHP Version5.2.6
Database Version5.0.33

Activities

dainius.bigelis

2009-08-05 11:05

reporter   ~0001362

The initial problem was, that the Label of this option was changed incorrectly and changed the meaning of related functionality, when the source code still works according previous meaning.
Pls rename this option to:
DE “Wie lange Artikel-Bewertungen gespeichert werden (in Tagen)”
EN: „How long product ratings are stored (in days)“

vilma_liorensaityte

2009-08-12 14:05

reporter   ~0001398

text changes