New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[studio] Remove empty folder tag in cascade on delete does not work in 2.5.x #1713

Closed
alhambrav opened this Issue Dec 19, 2017 · 2 comments

Comments

@alhambrav
Member

alhambrav commented Dec 19, 2017

Expected behavior

The parent folder of item deleted, should be deleted when the remove-empty-folder tag is set to true for 2.5.x

Actual behavior

The parent folder of item deleted, is not deleted when the remove-empty-folder tag is set to true for 2.5.x

Steps to reproduce the problem

  • Modify the file /cstudio/config/sites/SITENAME/content-types/page/entry/config.xml and add the following:
<delete-dependencies>
    <delete-dependency>
        <pattern>(^/static-assets/images/pages/.*)</pattern>
        <remove-empty-folder>true</remove-empty-folder>
    </delete-dependency>
</delete-dependencies>
  • Start Studio
  • Create a site using the empty bp
  • Create a new entry page, add an image using the RTE and notice where the image uploaded is placed in the static-assets:
  • Delete the newly created page, refresh your browser and notice that the folder containing the uploaded image is not deleted

When an image was inserted in the body using the RTE, the new file uploaded was placed in the following:
/static-assets/images/pages/6793/679323f9-fa20-7665-1d10-e8a04a723332/new1.png
Notice after deleting the page mine, the folder 679323f9-fa20-7665-1d10-e8a04a723332 (parent folder of new1.png) was not removed.

Here's a short clip of 2.5.x behavior of remove-empty-folder
https://www.useloom.com/share/b3fa9952d65d4cc5960f061d24eca3c1

For 3.0 behavior, please note the following:
When an image was inserted in the body using the RTE, the new file uploaded was placed in the following:
/static-assets/images/pages/4ef9c300-59cc-76a0-d22d-287ba66455ca/new1.png
Notice after deleting the page new, the folder 4ef9c300-59cc-76a0-d22d-287ba66455ca was also deleted. The tag remove-empty-folder seem to be working okay in 3.0 when set to true/false

Here's a short clip of 3.0 behavior of remove-empty-folder:
https://www.useloom.com/share/0777159da51d47de955446956173448a

Log/stack trace (use https://gist.github.com)

Specs: version, OS, browser, etc.

OS X, chrome browser
2.5.13 snapshot (latest studio code as of 12/19/2017)

@dejan-brkic dejan-brkic added this to Backlog/Scheduled in Crafter CMS v2.5.x Dec 21, 2017

@dejan-brkic dejan-brkic moved this from Backlog/Scheduled to In Progress in Crafter CMS v2.5.x Dec 21, 2017

@dejan-brkic

This comment has been minimized.

Show comment
Hide comment
@dejan-brkic
Member

dejan-brkic commented Dec 21, 2017

@dejan-brkic dejan-brkic assigned alhambrav and unassigned dejan-brkic Dec 21, 2017

@dejan-brkic dejan-brkic moved this from In Progress to Testing in Crafter CMS v2.5.x Dec 21, 2017

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Dec 22, 2017

Member

Verified fixed.

Member

alhambrav commented Dec 22, 2017

Verified fixed.

@alhambrav alhambrav closed this Dec 22, 2017

@alhambrav alhambrav moved this from Testing to Completed in Crafter CMS v2.5.x Dec 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment