Image Field is Not Working For Cases Module

Hello All,

Thank you all in advance for helping me out. In the cases module I created a Image Field from the Studio. When I Create a case and browse a image, it gets saved but in Detail View I can only see the Broken Image icon.

I have a custom module named Requests and I have an Image field in that and that works fine in that module. It seems that the issue is arising only for the Case Module. I really need this done. Please help me resolve this.

Regards,
Archit

I modified line 69 to 71 in download.php like this

   if(!file_exists('modules/' . $module . '/' . $bean_name . '.php')) {
            die('CASE2 - module=' . $module . ', bean_name=' . $bean_name . ', ' .  $app_strings['ERROR_TYPE_NOT_VALID']);
        }

and found out that in case of a Case it would look for a file called modules/Cases/aCase.php (because $bean_name is ‘aCase’, not Cases) and thus dies.

This is a bug and needs fixing. (Dirty) work-around is creating a link from Case.php to aCase.php

Yes, it looks like a bug.

I would add this line immediately before that “if”, in line 70:

if ($bean_name == 'aCase') $bean_name = 'Case';

There are other places in the code where this correction is made, but it seems to be forgotten in download.php.

Can you please try that fix to see if it’s ok?

2 Likes

The Fix Worked !! Thanks a lot

But I am having the same issue with the Employees Module. The image field there does not work as well.

9 months later, it’s nice to know the fix works. I had totally forgotten about this (you guys left “thank yous” but that doesn’t send me any notifications)

Maybe we should put this into the code for everyone, then.

I don’t know about the Employee image problem, it’s probably a different thing, and we would need some more info to look at it. Maybe you can try it on the live demo to see if it works well there.

https://www.softaculous.com/demos/SuiteCRM

This is now merged and will be in version 7.10.6 coming out soon.