BuzzingPixel

Ansel for Craft

Ansel for EE

Treasury

Construct

Category Construct

Dashboard (open an issue here)

All Issues

My Issues

News Contact
Log in

Logged in as

Licenses Purchases Profile Change Password Billing Portal Admin
Log Out
Software
Ansel for Craft Ansel for EE Treasury Construct Category Construct
Support
Dashboard (open an issue here) All Issues My Issues
News Contact
Log in
Logged in as:
Licenses Purchases Profile Change Password Billing Portal Log Out
Dashboard All Issues My Issues
Support Dashboard
  1. Home
  2. Home
  3. Support Dashboard
  4. View Issue

Ansel fields empty after creating drafts, breaking the entry preview feature

#166 opened by stefan

Subscribe

Details

See Comments

Public Issue

Visibility: Public
4 replies
Last reply by stefan
Created 10/29/2019 4:26 AM
Updated 12/27/2019 5:52 AM
Ansel for Craft 2.1.4
CMS Version: Craft Pro 3.3.13
PHP Version: 7.2.16
MySQL Version: MySQL 5.7.19

Description

The new Craft entry draft system is not working with Ansel, which breaks the entry preview feature. To reproduce the bug:

  1. Create an entry with an Ansel field and add an image to the field.
  2. Save the entry.
  3. Edit the entry, and click "Save as a draft" to create a new draft OR click "Preview" to automatically create a new draft.
  4. Leave the edit page but DO NOT click "update entry" to save the draft.
  5. Edit the entry. The Ansel field in the current version is now empty.
  6. Select "Draft 1" from the drop-down. The Ansel field contains the image.

If you delete the draft from the drop-down, the field contents is lost. The big problem is that Craft automatically creates a new draft when you use the entry preview, so this bug breaks that feature.

Replies

  • stefan

    Replied 12/1/2019 10:27 AM, Edited 12/27/2019 5:52 AM

    Very curious about any updates on this issue, since it essentially prevents updating Craft beyond 3.1.x?

  • TJ Draper

    Replied 12/4/2019 9:36 AM, Edited 12/27/2019 5:52 AM

    I'm so sorry I haven't been able to look into this yet. I've been pretty swamped. I just put it in this week's queue in my to-do manager so I should have some answers for you very soon.

  • TJ Draper

    Replied 12/7/2019 6:44 PM, Edited 12/27/2019 5:52 AM

    Sigh. Unfortunately, there is not a good or quick fix for this. Drafts were nowhere on the horizon when Ansel was first written and Craft essentially introduced breaking changes (this is not the only one) in a non-major version of Craft which isn't supposed to happen. Or at least, generally in a semver world isn't supposed to happen. I've been able to mitigate the damage on various issues, but this one is going to require serious re-architecture. For better or worse, and for a multitude of reasons, Ansel stores data in its own table. There is no concept of draft and the image gets moved over to a new entry ID when the draft is created and saved.

    I have begun planning for Ansel 3, which at this point is essentially going to be a re-write because of all the breaking changes Craft has been introducing.

    However, it's pretty discouraging that Craft breaks the API whenever they feel like it. I have expressed my disappointment, but it is what it is.

    In any event, I know that's probably not the answer you wanted to hear, but it's where we're at.

  • stefan

    Replied 12/27/2019 5:52 AM

    This is pretty unfortunate since the Ansel license i bought is basically useless if I want to run a fully patched Craft CMS and the site I'm working on relies heavily on Ansel. I really hope you manage to fix this - Ansel is a great plug-in, much superior to the lousy built-in image cropping feature of Craft. Also, you should probably consider removing support for Craft 3.2+ from the Ansel composer file, since they are not compatible as is.

Use Markdown for formatting

Details

See Comments

Public Issue

Visibility: Public
4 replies
Last reply by stefan
Created 10/29/2019 4:26 AM
Updated 12/27/2019 5:52 AM
Ansel for Craft 2.1.4
CMS Version: Craft Pro 3.3.13
PHP Version: 7.2.16
MySQL Version: MySQL 5.7.19
Cookie Policy
Privacy Policy
Terms of Service

© 2023 BuzzingPixel, LLC. All rights reserved.