Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

OpenTracker - Create URL via CRM_Utils_System::externUrl() #56

Merged
merged 2 commits into from
May 28, 2020

Commits on May 14, 2020

  1. OpenTracker - Create URL via CRM_Utils_System::externUrl()

    This aims to improve cooperation between `flexmailer`, `civicrm-wordpress:wp-rest/`, and
    civicrm/civicrm-core#17312 -- so that flexmailer produces compliant URLs.
    
    Before
    ------
    
    The open-tracking URL is constructed as a reference to the standalone script `extern/open.php`
    using certain `$config` properties.
    
    After
    -----
    
    On Civi v5.23+, it uses `CRM_Utils_System::externUrl()` API to request the full URL of
    `extern/open`.  Flexmailer is no longer responsible for figuring the URL, and other
    agents (via `hook_civicrm_alterExternUrl`) can do so.
    
    On Civi v5.22 and earlier, it continues using the same old formula. This provides
    drop-in/bug-level-compatibility on older versions. This can be removed in a couple months.
    
    Comments
    --------
    
    I suspect this also fixes [dev/mail#17](https://lab.civicrm.org/dev/mail/issues/17),
    wherein the open tracker has flawed URLs in certain multilingual configurations.
    However, I can't confirm for certain because I don't have that configuration.
    
    But just to game this out...
    
    * If the current patch fixes dev/mail#17, then huzza!
    * If it doesn't, then the problem is in `civicrm-core`'s `CRM_Utils_System::externUrl()`
      (not `flexmailer:OpenTracker.php`). Which means:
        * The problem already affects other use-cases in `civirm-core` in v5.23+.
        * The fix should go in `civicrm-core`.
    
    Either way, addressing dev/mail#17 shouldn't require any further change in `flexmailer`.
    totten committed May 14, 2020
    Configuration menu
    Copy the full SHA
    f4bf887 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2020

  1. OpenTracker - Check compat by version# instead of is_callable()

    Generally, I think the `is_callable()` formulation is better.  However, this
    specific class (`CRM_Utils_System`) defines a `__callStatic()` magic-methods,
    which prevents `is_callable()` from being meaningful.
    
    So here's Plan B.
    totten committed May 16, 2020
    Configuration menu
    Copy the full SHA
    c4f95e1 View commit details
    Browse the repository at this point in the history