silverstripe / silverstripe-campaign-admin

Campaign and publishing admin interface for Silverstripe
BSD 3-Clause "New" or "Revised" License
2 stars 16 forks source link

Adding image to page after adding to Campaign prevents immediate publishing #163

Open Cheddam opened 4 years ago

Cheddam commented 4 years ago

Tested version: 1.6.x-dev

Outline

Adding an image (or presumably any other related object) to a Page that has just been added to a Campaign will prevent that Campaign from being published until the user reloads the CMS.

Steps to reproduce

(Ensure devtools are open)

  1. Create a Campaign
  2. Create a Page, save but do not publish it
  3. Add the Page to the Campaign
  4. Navigate to the Campaign admin, observe that the Page is listed in the Campaign
  5. Navigate back to the Page editor, add an image and save
  6. Navigate to the Campaign admin, observe that the new Image is not listed in the Campaign
  7. Attempt to publish the Campaign, observe no reaction in UI (and observe a 403 response in the Network tab of the devtools with error "ChangeSet does not include all necessary changes and cannot be published.")

I believe the issue may be occurring at Step 3, where the Page is added to the Campaign, as it seems like that state of the Campaign is 'sticking'. The Campaigns API sensibly refuses to publish when the user can't see everything that will be changed, but it also doesn't warn the user of the issue (better messaging is likely outside the scope of this issue - see #131.)