Menu
SuiteCRM dedicated support by SalesAgility
Welcome, Guest
Username: Password: Remember me

TOPIC: Audit module is not working in custom directory

Audit module is not working in custom directory 2 months 4 days ago #67826

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
I am adding a different layout for Created By in view change log screen with fields (name, date_entered, created_by_name). Also changing layout for this screen. However, Its not working.

Steps followed:

1) Copy the Audit module from {dir_name}/modules and paste it in {dir_name}/custom/modules
2) Made the necessary changes and its not working

Later, I removed other files and keep the necessary files (english folder, Popup_picker.html, Popup_picker.php). Still, its not working.

Any help will be appreciated.
The administrator has disabled public write access.

Audit module is not working in custom directory 2 months 4 days ago #67830

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
You shouldn't try to copy entire modules into custom directory, that surely won't work.

Copy just one file you need to customize. It will be combined with the others. Note that not all files are customizable, so you need to check if your changed version is getting picked up after a Quick Repair and Rebuild.
The administrator has disabled public write access.

Audit module is not working in custom directory 2 months 2 days ago #67949

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
I tried to add few files in which I made the changes. Still, no luck :(
The administrator has disabled public write access.

Audit module is not working in custom directory 2 months 2 days ago #67950

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
Maybe this can help you understand

pgorod.github.io/Audit-File-Accesses/
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 4 weeks ago #68175

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
I tried this one.. Now, the English folder is working but the other two files are not working (Popup_picker.html, Popup_picker.php).
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 4 weeks ago #68203

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
Not all files in SuiteCRM are customizable in an upgrade-safe manner. The "custom" directory scheme is not universal.

You can look for the place where those files are being included, or required, and see if it is looking in the custom directory for possible replacements.

You can see a PR I made a while ago trying to make a module more customizable, this will give you an idea of what I mean:

github.com/salesagility/SuiteCRM/pull/3891/files
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68243

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Sry, I am not getting it. When I used get_custom_file_if_exists then its returning same path which I mentioned inside it. If I add custom folder and file not existing in custom folder then its not throwing error even.
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68244

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
What is the exact path of the file you are trying to use from custom folder?

And where is that file (or the original version, not from custom folder) getting loaded in the core code, did you find out?
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68245

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Custom folder file path is: {root}/custom/modules/Audit/Popup_picker.php

And in the original version file path is: {root}/modules/Audit/Popup_picker.php

Currently, I made changes in {root}/modules/Audit/Popup_picker.php. When I'll upgrade suitecrm version then I'll lost all the changes.
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68257

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
Thanks. And where do you go in the app, to get to that screen? Which menus, which buttons do you press?
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68259

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Go to any screen.. I mean lead, policy, invoice etc and click the detail view or edit view of any Invoice, Lead, Policy etc. Then, there is a button to check the change log "View Change Log". Click it and it will show a popup window with change log history.
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68269

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
Ok, try to add the get_custom_file_if_exists in this line

github.com/salesagility/SuiteCRM/blob/ma.../view.popup.php#L227

and see if it works.
The administrator has disabled public write access.
The following user(s) said Thank You: indivar-hk

Audit module is not working in custom directory 1 month 3 weeks ago #68274

  • indivar-hk
  • indivar-hk's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Thanks! Its working now..


I have one question. Is this file is used for only Audit module popup or its used for other popups also?
I guess I need to put condition module wise...
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68287

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
It's used in most other modules. But you don't have to put any condition, it will only use a custom file if there is a custom file in custom/MODULE_NAME/Popup_picker.php, so nothing will happen for the other modules, since there is on custom file there.

Note that this change is not upgrade safe either. It's just a confirmation of where this could/should be changed in the core code.
The administrator has disabled public write access.

Audit module is not working in custom directory 1 month 3 weeks ago #68306

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 7033
  • Thank you received: 1076
  • Karma: 250
I made a PR so this can be made in an upgrade safe manner in the future

github.com/salesagility/SuiteCRM/pull/6072
The administrator has disabled public write access.
The following user(s) said Thank You: indivar-hk
Time to create page: 0.132 seconds
Powered by Kunena Forum