2

The file defines paths and callbacks, e.g.:

<item> <path>civicrm/mailing/optout</path> <title>Opt-out</title> <page_callback>CRM_Mailing_Form_Optout</page_callback> <access_arguments>access CiviMail subscribe/unsubscribe pages</access_arguments> <is_public>true</is_public> <weight>650</weight> </item>

However, changing values in the file doesn't seem to produce any result. I changed the page callback above to CRM_Mailing_Page_Optout but the content served was again coming from CRM_Mailing_Form_Optout.

So how can I make any changes to the callbacks?

1
  • Check it after clearing the civicrm temporary files.
    – Prem Patel
    Commented Dec 27, 2015 at 9:09

1 Answer 1

2

If you are planning on submitting a change to CiviCRM, then modifying this file may be what you want to do to modify the existing behaviour. Clearing CiviCRM's caches (Administer → System Settings → Cleanup Caches and Update Paths) will reload those callbacks as defined in the XML. But: You probably don't want to do this :)

If you're hoping to customise your CiviCRM install and be able to keep your site upgraded in future, stop now. Instead I recommend you look into how to write a custom CiviCRM extension for your site, which packages your changes separately from the main codebase.

By writing an extension using CiviCRM's published interfaces, you can upgrade to the next release more easily. On your current path you'll soon be maintaining a modified version of the CiviCRM codebase, which will introduce more and more upgrade challenges, leaving you / your client in a more difficult position.

2
  • Thanks very much for your detailed recommendations, @Chris. What if I would like to introduce a change in the Civi codebase because I think the current behavior leads to undesirable results? A big part of my motivation to submit patches/changes to the core codebase is so that all organizations could benefit from the improvements. Would you still recommend creating an extension in that case? Commented Dec 28, 2015 at 23:15
  • 1
    In that case, definitely submit as an improvement! Open an issue in JIRA with your motivations, submit a PR via github, link to it from the issue. Commented Dec 29, 2015 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.