0

I have been getting this error pointing to this function

protected function _checkSrcIsFile($src)
{
    $result = false;
    if (is_string($src) && is_readable($src) && is_file($src)) {
        $result = true;
    }

    return $result;
}

and the funtion is being passed here:

$srcIsFile = $this->_checkSrcIsFile($src);
if ($srcIsFile) {
    $src = realpath($src);
    $result = $this->cp($src, $filename);
} else {
    $result = $this->filePutContent($filename, $src);
}

if (!is_null($mode) && $result !== false) {
    $this->chmod($filename, $mode);
}

return $result;

can anyone explain to me what is causing this and what is the solution and how can I recreate it.

Thank you.

0

I've you use an older Magento version (<1.9.3.1?) this seems to be a bug in Varian lib.

Current version supresses is_readable error (@ is_readable())...<

protected function _checkSrcIsFile($src)
{
    $result = false;
    if (is_string($src) && @is_readable($src) && is_file($src)) {
        $result = true;
    }

    return $result;
}

Edit:

No, it is still there ... it's "fixed" only in LTS project ...

See https://github.com/OpenMage/magento-lts/pull/85

Instead of supreess error it should also work to check if(file_exists($src)) before is_readable().

  • With this above "Fix" its not much of a fix for my solution because I am using version 1.4 and the warning keeps on showing up in the system.log I don't understand if if(file_exists($src)) should be in the safe if statement as is_readable to make the warning go away? – Maneza F8 Apr 23 at 5:45
  • So there is practically no solution for this is_readable() because suppressing it with @ did not work, and I haven't find out what is causing it. in my case I think it goes together with Notice: iconv(): Wrong charset, conversion from `MacRoman' to `UTF-16BE' is not allowed in /data/vhosts/edgars/web/lib/Zend/Pdf/FileParser.php on line 451 because everytime iconv notice is thrown is_readable() will follow, what I think this is thrown when text is being change to pdf. like invoices or order information. what I can not get is the solution. – Maneza F8 Apr 24 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.