Links in mails fail - extern/url.php fails to find configuration via civicrm.config.php
Overview
Links in mails result in an error Could not load the settings file at: ...
CiviCRM 5.24.2 Backdrop 1.15.1
Reproduction steps
This depends on the location of the civicrm module relative to the backdrop root directory. In a default install, the settings file is in BACKDROP_ROOT
with civi in BACKDROP_ROOT/modules/contrib/civicrm
- Create a mail containing a link
- Send mail
- Link should be https://example.org/modules/contrib/civicrm/extern/url.php - click it and browser gives above error
Analysis
extern/url.php
requires ../civicrm.config.php
That has a comment saying "This function has been copied from BACKDROP_ROOT/core/includes/bootstrap.inc" but comparing to the referenced file shows the process to find the conf dir has been updated in Backdrop but not in our copy.
Options
- An easy fix is to change civicrm.config.php (via backdrop/civicrm.config.php.backdrop) and add another location check
- More complex and still not great is to refresh the copied functions
- There has been discussion about getting rid of extern (particularly around extern/ipn.php) - is there a plan for this?
I have a PR-able fix as per 1) but would be good to get an answer re 3)
Comments
This was noted on a new install with current versions and defaults. Don't know whether this worked out of the box previously but does not look to be connected to any recent core changes.
Environment information
- CiviCRM: 5.24.2
- PHP: 7.3
- CMS: 1.15.1