Hi,
I’m trying to understand how customization and overriding of modules exactly work in SuiteCRM8.
More specificity, I don’t understand the difference between the custom/Extension/Modules folder and the custom/Modules foder
What I found in details:
I was trying to add a custom js file onto the Document module with this simple code :
$viewdefs['Documents']['EditView']['templateMeta']['includes'] =
array(
array(
'file' => 'custom/Extension/modules/Documents/js/editview.js',
),
);
At the first place, I added it here :
public/legacy/custom/**Extension**/modules/Documents/metadata/editviewdefs.php
But with no effect after repair and rebuild
Then, I added the same code at the end of this file :
public/legacy/custom/modules/Documents/metadata/editviewdefs.php
(not in the Extension folder)
Problem is that this file is rebuild by studio, so I create a new file in the public/legacy/custom/modules/Documents/metadata/
. This one is not removed by Studio.
What is weird is that change in custom/Extention/modulesExt/Vardefs/somefile.php
work.
Also, sudio add the exact same code in both folder, but there is one file per fields in the custom/Extention/modules
folder, and it’s merged in one file in the custom/modules folder :
files in public/legacy/custom/Extension/modules/Documents/
example code
// created: 2022-06-03 15:35:30
$dictionary['Document']['fields']['t1_champ1_c']['inline_edit']='1';
$dictionary['Document']['fields']['t1_champ1_c']['labelValue']='t1 champ1
files in public/legacy/custom/Extension/modules/Documents/
example code
// created: 2022-06-03 15:35:30
$dictionary['Document']['fields']['t1_champ1_c']['inline_edit']='1';
$dictionary['Document']['fields']['t1_champ1_c']['labelValue']='t1 champ1';
// created: 2022-06-07 17:25:23
$dictionary['Document']['fields']['type_c']['inline_edit']='1';
$dictionary['Document']['fields']['type_c']['labelValue']='type';
//...
My question precisely :
all of this bring me to this questions :
- all of this is the normal behavior ?
- if yes, what is the good practice? when put code in the custom/Extension/modules folder, and when put code direcly in custom/modules folder?