Ticket #13487 (closed Bug: fixed)

Opened 14 months ago

Last modified 13 months ago

Selection all in collection view selects "everythig on the site"

Reported by: espenmn Owned by:
Priority: blocker Milestone: 4.x
Component: General Version: 4.3
Keywords: Cc: esteele


1) Add a collection 2) Go to  http://path_to/collection/folder_contents 3) Click on "select all"

Instead of selecting everything in the collection, everything on the site is selected. (IF you use collections for deleting content, this could be quite serious)

Change History

comment:1 Changed 14 months ago by espenmn

  • Priority changed from minor to major

comment:2 Changed 13 months ago by kleist

  • Priority changed from major to critical
  • Cc esteele added
  • Status changed from new to confirmed
  • Component changed from Unknown to General

Promoting to "Critical", and if it's true what you say about deleting (I haven't tried it) maybe we should even consider fixing it before cutting 4.3 ?

Last edited 13 months ago by kleist (previous) (diff)

comment:3 Changed 13 months ago by esteele

Is this using the old collections or plone.app.collection?

comment:4 Changed 13 months ago by danjacka

Confirmed in 4.3rc1. Applies to plone.app.collection collections only, not old collections.

Note that it's not "everything on the site" that's selected, but everything inside the collection's container (including the collection itself).

Hitting delete does actually delete all the content (i.e. it's not a mere UI glitch).

Last edited 13 months ago by danjacka (previous) (diff)

comment:5 Changed 13 months ago by danjacka

Works as expected in 4.2.5.

I wonder if we've introduced this bug when removing KSS from plone.app.content?

comment:6 Changed 13 months ago by danjacka

The problem traces to the <base> tag value in new collection pages. New collections are not folderish, so in plone.app.layout.globals.layout.renderBase the base value is set *not* to include a trailing slash. Then, folder_contents.js in plone.app.content calls jQuery.get for a relative URL

$.get('foldercontents_get_table', ... );

.. so on a page like http://localhost:8080/Plone/collection/folder_contents - which has <base> set to http://localhost:8080/Plone/collection - the URL this code reads from is http://localhost:8080/Plone/foldercontents_get_table.

In order to successfully get http://localhost:8080/Plone/collection/foldercontents_get_table, the <base> needs that missing trailing slash, i.e. be http://localhost:8080/Plone/collection/.

I've not checked in detail, but guess 4.2.x isn't affected because KSS uses its data-kss-base-url, not <base>.

comment:7 Changed 13 months ago by esteele

  • Priority changed from critical to blocker

comment:8 Changed 13 months ago by danjacka

Potential fix here:  https://github.com/plone/plone.app.content/pull/4

The approach is: on @@folder_contents assume the context is folderish and explicitly set the <base> tag for folderish content i.e. with a trailing slash.

This might not be the best approach though, and I'm happy to defer to a better solution.

comment:9 Changed 13 months ago by esteele

  • Status changed from confirmed to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.