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

Same mailing open in two windows can overwrite data on scheduled mailings

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.22
    • Fix Version/s: 4.7.27
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      As we know, Civi can do some weird stuff if you have multiple tabs open. Here's another example.

      When you have a mailing open in two different tabs, you can accidentally overwrite data even if the mailing has been submitted!

      Steps to recreate:

      • Create a new mailing, add a name, title, recipients, subject and some text... (A)
      • Copy the URL of the mailing, paste it into a new tab (B)
      • On the original (A) choose 'Next' and submit the mailing
      • On the other tab (B) change the groups, and the text, an autosave triggers (or you click 'save draft')
      • The mailing, which is already scheduled, will be sent with the changes that were made on the other tab (you can see this in the database)

      This can happen with multiple tabs on the same PC, or different users on different PCs (if two people end up working on the same mailing).

      Proposed solution:

      Prevent cross-editing of mailings

      When a mailing is opened, or saved, record the 'last modified' time in the page. Then, whenever a mailing is saved - either via autosave, save draft, or to submit a mailing - check to see if the 'last modified' time we loaded is the same as the 'last modified' time in the database. If it is, then continue, if not then display an error: 'The mailing has been updated in another window. Please make a note of your changes and reload this page' (or similar).

      For an example of this in action please see the comments.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                john John K.
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: