[FATAL] AOS_Products save - Invalid image file ext : ''. (after upgrade to 7.13.1)

Hello everybody.

After upgrade to 7.13.1 when I save the Product, I get white screen and error message:

[SECURITY] Invalid ext AOS_Products Uploaded image file: : ‘’.
[FATAL] AOS_Products save - Invalid image file ext : ‘’.
[FATAL] Exception handling in /opt/lampp/htdocs/sugarcrm/include/MVC/Controller/SugarController.php:397
[FATAL] Exception in Controller: Invalid request

But the Product doesn’t have any picture :frowning: When I try to add one, I get an error too.

Any idea?

My configuration: Apache/2.4.54 (Ubuntu), PHP/7.4.33, MariaDB/10.4.27

1 Like

Hello
Same error on 8.2.3
Did you find a solution?

I don’t use pictures. Therefore, until I find a solution, I disabled the lines:

if (!has_valid_image_extension('AOS_Products Uploaded image file: ’ . $imageFileName , $imageFileName)) {
LoggerManager::getLogger()->fatal(“AOS_Products save - Invalid image file ext : ‘$imageFileName’.”);
throw new RuntimeException(‘Invalid request’);
}

in file sugarcrm/modules/AOS_Products/AOS_Products.php. For me it works…

4 Likes

Hello, I´ve got the same error on my Version 7.13.1
Sugar Version 6.5.25 (Build 344)

Dear krzaychoos, can you please let me know how to “disable” that lines?
I tried commenting with “//” but with no luck.

Thanks!

1 Like

Use:
/*

*/

like in PHP file :slight_smile:

2 Likes

Worked like a charm, thanks a lot!

/*
if (!has_valid_image_extension('AOS_Products Uploaded image file: ’ . $imageFileName , $imageFileName)) {
LoggerManager::getLogger()->fatal(“AOS_Products save - Invalid image file ext : ‘$imageFileName’.”);
throw new RuntimeException(‘Invalid request’);
}
*/

3 Likes

same error here 7.13.1. Does anyone know if a fix is planned for the next release and if the bug is known during development? I only see workarounds here at the moment.

I see that bug is known. Look here:

1 Like

BUG: Products module functionality · Issue #9926 · salesagility/SuiteCRM · GitHub

There is work around.
If you select image save will work. Image is not required but at this moment if you don’t select image you get blank page on save.

Hi @kraychoos

with my case. must disable more than, included :: $imageFileName = $_FILES[‘uploadimage’][‘name’] ?? ‘’;

/*** 
    $imageFileName = $_FILES['uploadimage']['name'] ?? '';
    if (!has_valid_image_extension('AOS_Products Uploaded image file: ' . $imageFileName , $imageFileName)) {
        LoggerManager::getLogger()->fatal("AOS_Products save - Invalid image file ext : '$imageFileName'.");
        throw new RuntimeException('Invalid request');
    } 
***/

This image issue saving 's solved! (7.12.9 and 7.13.1)
Thank you !

This is the solution (not just a workaround, but a fix):

1 Like