Jump to content

prestashop 1.6.1.24 function updateLogo (NOT CORRECT)


itmag.pro

Recommended Posts

/public_html/controllers/admin/AdminThemesController.php

protected function updateLogo($field_name, $logo_prefix)
{
    // OK, PHP upload_tmp_dir accessible for read/write
    echo $_FILES[$field_name]['tmp_name'];exit;
    /tmp/phpG9zHIi

    $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS');
    echo $tmp_name;exit;
    // OK, temp file move_uploaded_file() to
    /public_html/img/tmp/PSDv6zcS

    // OK, ImageManager::resize() copy files to _PS_IMG_DIR_
    /public_html/img/
    // with new names by as:
    // specled-logo-1689021933.jpg
    // specled-logo_invoice-1689021765.jpg
    // specled-logo_mail-1689021709.jpg

    // AFTER OLD FILE DELETE
    @unlink(_PS_IMG_DIR_.Configuration::get($field_name));
    ...
    // BUT ON NEXT LAST 3 lines configuration NOT UPDATED
    Configuration::updateValue($field_name, $logo_name, false, $id_shop_group, $id_shop);
    Hook::exec('actionAdminThemesControllerUpdate_optionsAfter');
    @unlink($tmp_name);
}

IN RESULT:

  • - new file created;
  • - old file deleted;
  • - configuration "$field_name" NOT UPDATED and we have broken design!

also no any php errors in error_log='/path_to_log' when I play with this function.

I search in DB by key "PS_LOGO_INVOICE" and see 2 line, that in one has "date_upd" field be modified when I try upload logo

installed 2 themes may be where somethings wrong with "id_configuration"

ps-theme-config1.jpg

...UPDATE...

switch theme to default-bootstrap and back only broken my design but not solved problem with upload logo!;(

PS THIS UNPOSIBLE BIG AND PERMANENT PROBLEM...I dont known any other ...malformed engine.

Edited by itmag.pro
add screenshot (see edit history)
Link to comment
Share on other sites

  • itmag.pro changed the title to prestashop 1.6.1.24 function updateLogo (NOT CORRECT)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...