Large number of contributors causes error in story
(This is on 1.10.7, but probably applicable to newer Bricolages.)
When a story has a large number of contributors (larger than the pagination number), several bad behaviours emerge:
- The edit-contributors screen inside the story offers pagination
and "show all" links, but these do nothing when clicked.
- The order of contributors set with the number-pulldowns is not respected. For example, set one contributor to #1, then save and stay. The #1 spot will be occupied by a contributor other than the one just selected.
My best guess is that pagination and user-controlled ordering are not playing well together. So if there are 55 contributors, and the first 50 show up on the edit screen, contribs 51-55 do not get order numbers at all, and this snaps them to the head of the line on a save.
I'm not sure there's an easy way to do user-controlled ordering without having all the elements (in this case, contributors) present at once.
Anyway, a quick fix that worked for me was a change to /comp/widgets/listManager.mc. Here's a summary:
I removed the line initializing $limit fron the <%init> block, and added $limit to the <%args> block, with the default value set to the same thing that used to be present in the <%init>:
Bric::Util::Pref->lookup_val( 'Search Results / Page' ) || 0
Then, in /comp/widgets/story_prof, in the call to listManager.mc, I set the limit to a number three times larger than the total number of contributors in the system. Now the screen shows all the contribs in the story, and everything works fine.
Obviously, this introduces a hard-coded value where there shouldn't be one. Would it just be smarter to have listManager.mc check for sorting by order, and have it set $limit to 0 whenever that is the case?
Comments and changes to this ticket
- State changed from open to resolved
(from [173f809567c4ad45b3a355bfcc0f60e80d87da9e]) Disable category and contributor pagination in docs.
This commit fixes a few issues, discovered and fixed in reaction to Bug [#121 state:resolved]:
When editing contributors associated with a story or media document, they are no longer paginated. When there were more contributors than would fit on a paginated page, the pagination didn't work and reording didn't work. So by disabling pagination in this case, we get around that issue. Documents with that many contributors are rare, so the trade-off seems worthwhile.
The same turned out to be true for categories when they were displayed and the
bricolage.confdirective was true. So pagination is now diabled there, too.
While at it, the ordering of categories displayed as such was borked, so I fixed it so that they display in URI order, which is what had been expected in the first place.
And finally, when associating contriutors with a media document, the user was prompted to select a role, even if there was only one. We now skip that step, as we had been doing with stories for a while now. http://github.com/bricoleurs/bricolage/commit/173f809567c4ad45b3a35...