1. 01 Jun, 2020 2 commits
  2. 30 May, 2020 1 commit
  3. 21 May, 2020 2 commits
  4. 20 May, 2020 7 commits
  5. 13 May, 2020 1 commit
    • totten's avatar
      wp-rest - Adjust extern URL. Be more defensive about 'query' part. · 464051c9
      totten authored
      Overview
      --------
      
      `hook_civicrm_alterExternUrl` allows for modifications to certain callback
      URLs (e.g.  CiviMail open/click-through URLs). As a hook, there may be multiple
      parties which weigh-in.
      
      This fixes an interaction that arises in the following conditions:
      
      * Use Civi+WordPress
      * Set `CIVICRM_WP_REST_REPLACE_MAILING_TRACKING` to `TRUE`
      * Use https://github.com/civicrm/civicrm-core/pull/17312
      * Send a mailing (or test email) with a tracked link
      
      Before
      ------
      
      The tracked link is converted to something like
      
      ```
      http://wpmaster.bknix:8001/wp-json/civicrm/v3/url?page=CiviCRM&q=civicrm/mailing/url&u=5&qid=67
      ```
      
      On the plus side, this includes query parameters `u=5&qid=67` - which are important inputs for any `extern/url`-style end-point.
      
      On the downside, the URL is mixing up artifacts which identify different end-points, ie
      
      * `wp-json/civicrm/v3/url` suggests the `wp-rest` end-point
      * `?page=CiviCRM&q=civicrm/mailing/url` suggests the #17312 end-point
      
      After
      -----
      
      The tracked link appears as:
      
      ```
      http://wpmaster.bknix:8001/wp-json/civicrm/v3/url?u=5&qid=68
      ```
      
      Notice that this unambiguously uses the `wp-rest` end-point.  It includes
      the important `u=5&qid=67` but skips the irrelevant `q=civicrm/mailing/url`.
      
      Technical Details
      -----------------
      
      The contract for `hook_civicrm_alterExternUrl` allows multiple parties to
      weigh-in on the URL. In this case, we have 3 parties which can generate
      the URL:
      
      * One function suggests the original standalone scripts
      * Another function suggests the #17312 routes
      * Another function suggests the `wp-rest` routes
      
      Notably, all of these parties have the aim of *choosing the end-point*, so they
      should construct the full `$url`.
      464051c9
  6. 02 Apr, 2020 6 commits
  7. 24 Mar, 2020 3 commits
  8. 20 Mar, 2020 3 commits
  9. 13 Mar, 2020 1 commit
  10. 12 Mar, 2020 3 commits
  11. 11 Mar, 2020 1 commit
  12. 05 Mar, 2020 1 commit
  13. 04 Mar, 2020 1 commit
  14. 26 Feb, 2020 2 commits
  15. 14 Feb, 2020 2 commits
  16. 13 Feb, 2020 2 commits
  17. 12 Feb, 2020 1 commit
  18. 04 Feb, 2020 1 commit