If a view holds more than 1 “Weight Changer” widget (in different displays), and if a page tries to show them simultaneously:

  • Form submission breaks as they all share the same $formid (based on $view->name); typically all submissions will be forwarded to the first Weight Changer;
  • Tabledrag breaks because all the Weight Changer ids are the same; typically only the first Weight Changer gets a functional tabledrag feature.

This patch fixes both problems:

  1. The $view->current_display is added to the $id; that fixes the tabledrag problem;
  2. The $id is added to the $formid, to get a distinct $formid per form. As this breaks the hook_form call, a hook_forms handler is added to redirect all internal form calls to the weight_view_weight_form function;
  3. The new $formid name breaks the theming as well, we force use of our own theme with the #theme key in the $form.

Hopefully this report is clear enough for at least the maintainer!

CommentFileSizeAuthor
weight-changer-multiple.patch1.41 KBptaff

Comments

davisben’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.