Need to create upgrade safe changes to Surveys

Based on the following post: Surveys - Customize HTML layout to match enterprise visual code I was able to customize my survey. Now I’m trying to do more changes but unfortunately I’m afraid they will be lost on upgrade because for some reason the system is not picking files from the custom folder. Specifically files in folder modules/Surveys/Entry

How can I force the system to first pick up custom files for this module?

Any help will be appreciated.

@AlxGr

I don’t see the problem. You should create entrypoints which override entrypoints for module Surveys.
For example:

  1. make file: custom/Extension/application/Ext/EntryPointRegistry/Mysurvey.php
  2. write code:
<?php
  $entry_point_registry['survey'] = array(
      'file' => 'custom/module/Surveys/MySurvey.php',
      'auth' => true,
  );
  1. create file: custom/module/Surveys/MySurvey.php with your code.
2 Likes

That’s a good answer. The thing is that I’m planning to do other changes to the other folders as well.

For remember seen this post make customizations persistent from upgrades will try to see if it applies to my situation.

You can ask here about each change. Sometimes you can’t change file A in an upgrade-safe way, but it is required by file B, so indirectly you can make a custom B require your custom A.

Other times you can do similar things but with classes. I have a feeling that many (though not all) of the things that people say are not possible to customize in SuiteCRM are actually possible, though they require a few tricks…

@p.konetskiy, @pgr,

I appreciate your responses. Will start testing and I’m sure I will come back with more questions .

1 Like

I think that about 80% may be customised if you understand the code a little. :handshake: :wink:

1 Like

@AlxGr

You can do for Calendar and other modules which have file index.php.

  • copy modules/Calendar/index.php to custom/modules/Calendar/index.php
  • copy modules/Calendar/Calendar.php to custom/modules/Calendar/Calendar.php
  • copy modules/Calendar/CalendarUtils.php to custom/modules/Calendar/CalendarUtils.php
  • change require_once in custom/modules/Calendar/index.php
  • change require_once in custom/modules/Calendar/Calendar.php
  • write custom code in custom/modules/Calendar/CalendarUtils.php

It will work after upgrade.

The problem with these more complicated approaches, which involve copying more files, is that it increases the odds that a future upgrade, despite not breaking your customizations, breaks the new SuiteCRM code instead, because it overrides parts of the new changes coming in…

It’s a trade-off, you need to choose which provides more benefits and less risks in your case.

1 Like