• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Bug in uploadToWebsite function

Status
Not open for further replies.

Wink

Chevereto Member
Line 361 in app\lib\classes\class.image.php

PHP:
$datefolder = date('Y/m/d/');

We must use gmdate() function here, not date(), because in class.storage.php we have this:

PHP:
$datefolder = preg_replace('#'.CHV_PATH_IMAGES.'#', '', $destination, 1);
     
     if($datefolder) {
       $datefolder = str_replace('/', '-', rtrim($datefolder, '/'));
       $stock_qry .= 'AND DATE(image_date_gmt)=:image_date_gmt ';
       $stock_binds['date_gmt'] = $datefolder;
     }

and image_date_gmt is GMT time

OR maybe we need to fix class.storage.php?
 
class.storage.php is wrong, but this doesn't cause a system failure or anything like that. Is helps in optimization but that's it. I will patch it for the next release.

Thank you for warn about this.
 
Last edited:
By the way, this is the fixed code:

PHP:
        // Datefolder storage?
        $datefolder = rtrim(preg_replace('#'.CHV_PATH_IMAGES.'#', NULL, $destination, 1), '/'); // Destination datefolder?
        if(preg_match('#\d{4}\/\d{2}\/\d{2}#', $datefolder)) {
            $datefolder = str_replace('/', '-', $datefolder);
            $stock_qry .= 'AND DATE(image_date)=:image_date ';
            $stock_binds['date'] = $datefolder;
        }
        $stock_qry .= 'ORDER BY image_id DESC;';
 
Last edited:
I can confirm that this bug has been already fixed for the upcoming release (v3.8.4).
 
Status
Not open for further replies.
Back
Top