Ticket #7202 (closed Bug: fixed)

Opened 4 years ago

Last modified 4 years ago

folder_contents does not allow a 21st item (on page 2 of a list of contents) to be re-ordered

Reported by: grahamperrin Owned by: jvloothuis
Priority: critical Milestone: 3.1
Component: Navigation/Folder listings Keywords:
Cc: grahamperrin

Description

Plone 3.0.1

When there are 21 items in a folder, it's not possible to re-order the 21st item. It's alone on page 2 of the list of contents, so in this context the drag handle is useless.

Similar problems may occur where more than 21 items are contained within a folder.

An ideal solution could be to display all folder contents, or a user-defined number of items, on the page.

Workaround, inspired by  https://dev.plone.org/plone/ticket/6563 - disable at.kss and plone.kss in portal_kss

Attachments

table.pt Download (8.3 KB) - added by glenfant 4 years ago.
folder_position.py Download (857 bytes) - added by glenfant 4 years ago.

Change History

comment:1 Changed 4 years ago by optilude

  • Owner changed from optilude to jvloothuis

Seems like an off-by-one error somewhere in the server-side folder-listing code.

comment:2 follow-up: ↓ 3 Changed 4 years ago by hannosch

How should this be a off-by-one error?

On the second page the 21st item will already be the first one, so you cannot d'n'd it before any other item.

I see three ways of solving this:

  1. While the batch size stays 20, a click on next will only go either half the items (10) or items-1 (19) items forward. This way you keep some of the context in which you were and can reorder the 21st easily. Not sure what our usability people think of that.
  1. Add a dummy dropable area somewhere above the table that you can drop items on and which will position them at the end of the previous batch.
  1. Always show the up arrow for the first item and the down arrow for the last item in the batch.

Maybe there are some more ways...

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 7 Changed 4 years ago by grahamperrin

Replying to hannosch:

Maybe there are some more ways...

Option to define the batch size?

Option to view all (do not batch)?

If not a GUI for such options, might the options be achieved by crafting the URL in a particular way?

Many thanks for your consideration.

comment:4 Changed 4 years ago by grahamperrin

As a workaround, I make best use of collections (and categories) -- with sorting defined in the collection criteria.

comment:5 Changed 4 years ago by grahamperrin

  • Cc grahamperrin added

See also #7407, which may be a request for enhancement.


Incidentally the bug at #7491 could be handy but unintentional workaround if (say) someone wishes to nudge an item from position #20 to position #21.

comment:6 Changed 4 years ago by stainsby

Another option to fix this and also speed up folder operations on large folders: list folder items showing their index (starting at '1', '2', '3', ...) and allow the user to edit this number for an item. e.g. you could go to item 533 and change it to item 12. Obviously the other items 12, 13, .. will then renumber to 13, 14, ... and so a refresh of the listing is going to be needed.

comment:7 in reply to: ↑ 3 Changed 4 years ago by openprojects

MY personal little workaround: in plone.app.content.browser.tableview.py change line 23 FROM:

self.pagesize = 20

TO:

self.pagesize = int(request.get('pagesize',40))

This will: 1) Increase to page length to 40 elements (sounds already good to me) 2) Allow to pass a pagesize parameter. EG: @@folder_contents?pagesize=50

  • What's BAD:

1) This change (40 instead of 20) will reflect on ALL Plone sites 2) Need to pass pagesize parameter manually on URL... should be done in ATFolder properties...

  • What's GOOD:

For me, this works like a charme :)

Giorgio

comment:8 Changed 4 years ago by glenfant

  • Priority changed from major to critical

Other clever and elegant way to solve this: type in your address bar:

 http:///_your_plone_/_your_folder_/folder_position?position=xxx&id=yyyy

  • xxx = "up", "down", "top" or "bottom"
  • yyy = the id of the content you want to move

More seriously, IMHO :

  • The classical "up" and "down" arrows should show whatever the javascript is enabled or not.
  • The same column should have the "top" and "bottom" arrow too. Users often want to show the most recently added item first.
  • The drag'n'drop handle column should be appended on javascript enabled browsers and in any case and should not replace the "up/down/top/bottom" column.

Please, this bug is somehow critical in many situations and is 4 months old (in fact the age of Plone 3)

comment:9 Changed 4 years ago by glenfant

This works now like a charm for me...

Change lib/python/plone/app/content/browser/table.pt and Products/CMFPlone/skins/plone_scripts/folder_position.cpy with the provided files. Yes "folder_position" is a .py and *not* a .cpy.

Changed 4 years ago by glenfant

Changed 4 years ago by glenfant

comment:10 Changed 4 years ago by jvloothuis

  • Status changed from new to closed
  • Resolution set to fixed

There is now a change (for Plone 3.1) which allows you to disable batching for the folder contents view. This makes it possible to drag an item to wherever you want.

comment:11 Changed 4 years ago by glenfant

Thanks but I prefer my patch that has drag'n'drop feature *and* move up/down/top/bottom arrows.

Plone 3.1 has killed all 3rd party components I use that add javascript, so it's not an immediate option for my production site.

comment:12 Changed 4 years ago by wichert

glenfant: I have never seen a single message or bugreport about Plone 3.1 breaking third party products. Such information is *critical* for us, so I am very surprised to only see a remark on a bugreport with a statement to that effect.

If Plone 3.1 breaks things for you please talk to us on plone-developers or submit a bugreport.

Note: See TracTickets for help on using tickets.