Hi,
Iām currently in SuiteCRM version 7.11.18 and i encounter something like a cache problem (from my point of view).
I have exhausted all my ideas and have not seen any answers to my questions in this forum or elsewhere, so iām asking to you, community, if someone already encountered this problem.
Objective:
I would like one of my ārelateā field to open a popup with search fields in 99% of the cases and with one search field more in one specific case (when opened from a particular module, letās call it āSpecificModuleā).
What i did:
- In custom/<Module>/controller.php iām currently overriding action_Popup() to conditionally load a different view:
- $this->view = āpopupā; (99% of the cases)
- $this->view = ācustompopupā in one case (when I open_popup() from my module āSpecificModuleā)
- I have one custom file (view.custompopup.php) for the view loaded in my specific case in which i do
$_REQUEST['metadata'] = 'custompopup';
The goal of this line is to load the file custompopupdefs.php instead of the regular popupdefs.php.
I did this because i saw it used in the display() function from include/MVC/View/views/view.popup.php.
- So when i open the popup from the EditView of my module āSpecificModuleā, the custompopupdefs.php is loaded and i have my additional search field
The problem:
When i open the popup a cache file is generated: cache/themes/SuiteP/modules/<Module>/SearchForm_popup_query_form.tpl.
This file seems to override everything when it exists, if I load one of my popupdefs, the other wonāt display what it should:
- if custompopupdefs loaded first, the additional search field will always be there
- if popupdefs loaded first, the additional search field will never be there
The only workaround i achieved to find is to erase this cache file (SearchForm_popup_query_form.tpl) before displaying the popup. When i put the below code in the action_Popup() of controller.php it works as expected :
include_once('modules/Administration/QuickRepairAndRebuild.php') ;
$repair = new RepairAndClear();
$repair->repairAndClearAll(array('clearThemeCache'), array(translate('<Module>')), true, false);
This solution to the problem doesnāt really suit me. Do you have any idea how to solve this problem?
If you have any questions about my case, let me know