Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-17959

Mailing URL redirection doesn't work if the queue ID is wrong

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.10
    • Fix Version/s: 4.7.9
    • Component/s: CiviMail
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      We have recently introduced mailing archiving, where the sizable civicrm_mailing_* tables are trimmed so that they only hold the data for mailings sent in the past 90 days. However, we soon noticed that people couldn't click on the links in emails sent more than 90 days ago, since the link refers to the civicrm_mailing_event_queue table, which was one of the tables to be trimmed (note that we didn't archive the civicrm_mailing_trackable_url table).

      This surprised me, since the URL was still available. Also, if you viewed the mailing from CiviCRM, the links click through (the queueID field isn't set in that case).

      Looking at the code, it's clear that it's inconsistent. If the queue ID isn't provided (but the URL ID is valid), then the URL is redirected as expected (although not tracked). However, if the queue ID is provided but not valid (with the URL ID valid), then the URL is redirected to the base URL (undesirable behaviour, not to mention unhelpful to people who are trying to view the link).

      So I'm creating a pull request to align the behaviour. If there's a valid URL ID, then the page is now correctly redirected, regardless of whether the queue ID is absent, or the queue ID is present but invalid.

        Attachments

          Activity

            People

            • Assignee:
              timotten Tim Otten
              Reporter:
              andrew_dockery Andrew Cormick-Dockery
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: