The message "Warning: No file uploaded" appears on top of the screen every time I edit products in the attributes controller. Additionally, I get the following warnings in the log file:
[06-Mar-2019 06:45:44 CST6CDT] Request URI: /admin/attributes_controller.php?action=update_product_attribute&attribute_page=1&produ cts_filter=145
#1 trim() called at [/admin/includes/functions/general.php:434]
#2 zen_not_null() called at [/includes/classes/upload.php:85]
#3 upload->parse() called at [/admin/attributes_controller.php:507]
--> PHP Warning: trim() expects parameter 1 to be string, object given in /admin/includes/functions/general.php on line 434.
[06-Mar-2019 06:45:44 CST6CDT] Request URI: /admin/attributes_controller.php?action=update_product_attribute&attribute_page=1&produ cts_filter=145
#1 is_uploaded_file() called at [/includes/classes/upload.php:89]
#2 upload->parse() called at [/admin/attributes_controller.php:507]
--> PHP Warning: is_uploaded_file() expects parameter 1 to be string, object given in /includes/classes/upload.php on line 89.
I found that line 82 of /includes/classes/upload.php:
Code:
'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : ''),
has different pattern than the previous three lines, e.g. line 81:
Code:
'size' => (isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : ''),
So, I changed line 82 to match the previous lines pattern into:
Code:
'tmp_name' => (isset($GLOBALS[$this->file . '_tmp_name']) ? $GLOBALS[$this->file . '_tmp_name'] : ''),
And the warning message disappeared. So did the log file warnings.
Is this a bug or I'm missing something.
ZC version: 1.5.6a.
PHP Version: 7.2.0-dev
MySQL 5.6.42-84.2-log
Bookmarks