View Issue Details

IDProjectCategoryView StatusLast Update
0001557OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:45
Reporteravenger Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version4.3.0 revision 26948 
Summary0001557: Wrong handling of "no picture" situation in "getPictureUrl()"
DescriptionThe "public function getPictureUrl(..." in "core/oxconfig.php" returns wrong "nopic"-information, in case the picture defined is not found.

Code:

        //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW.
        if (!$sUrl) {
            return $this->getTemplateUrl()."../".$this->_sPictureDir."/0/nopic.jpg";
        }

"$this->getTemplateUrl()."../".$this->_sPictureDir."/0/nopic.jpg";" e.g. yields something like:

Code:

"...../out/powertemplate/tpl/../pictures/0/nopic.jpg"

which, of course, is not the valid picture path....

The valid picture path ought to be

Code:

"...../out/pictures/0/nopic.jpg"

instead...

Also, the routine always returns the "nopic" in thumbnail size, regardless of the picture size requested (e.g. "icon").

The following code will ensure, that a.) the valid picture path is returned and b.) the proper 'nopic.jpg' is returned from the same directory as the picture requested.

Code:

        if (!$sUrl) {
            $sPicPath=explode('/',$sFile);
            $sPicPath[sizeof($sPicPath)-1]='nopic.jpg';
            $sPicPath=implode('/',$sPicPath);
            return $this->getOutUrl().$this->_sPictureDir.'/'.$sPicPath;
        }

Another problem in that context:

If it was once concluded in "getPictureUrl()", that a picture was not availble, it will not help, if you upload the missing picture....

Instead, the "missing picture" info will always be directly supplied from the cache.
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

arvydas_vapsva

2009-12-14 13:37

reporter   ~0002214

Fixed code line looks like:

    if (!$sUrl) {
        $sUrl = $this->getUrl( "0/nopic.jpg", $this->_sPictureDir, $blAdmin, $blSSL, $blNativeImg, $iLang, $iShopId );
    }

"oxConfig::getPictureUrl()" is not intended to handle special cases, just assures that non existing image url is not returned. So i did not add additional logics for checking image type.

arvydas_vapsva

2009-12-14 13:38

reporter   ~0002215

fixed