Error in SearchForm2.php when having a function in field definition #7084
Labels
Priority:Moderate
Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds
Type:Bug
Bugs within the core SuiteCRM codebase
Milestone
Issue
If you have a field in vardefs.php defined like this:
And loading a subpanel of that module a Warning appears:
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'get_products' not found or invalid function name in /home/jose/trabajos/gca-suitecrm7.10x/include/SearchForm/SearchForm2.php on line 693
In the context of line 693 of
include/SearchForm/SearchForm2.php
you can see:The problem is that the code execute a require_once only in the IF structure and not in the ELSE structure.
Expected Behavior
To require the function defined in vardefs.php
Actual Behavior
In some cases do not require the function
Possible Fix
Execute the require_once before the if..else structure or in both if and else.
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: