Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6850 (closed defect: untested)

Opened 2 years ago

Last modified 1 year ago

[PATCH] oldParentNode might not exist if a Draggable's parent is destroy()'d

Reported by: kampers Assigned to: thomas@fesch.at
Priority: normal Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords: oldParentNode
Cc:

Description

The code unconditionally fires events on oldParentNode when dragging from Sortable A to Sortable B. Sometimes, Sortable A might no longer exist, so this produces an error.

For example, it seems to be reasonable to temporarily destroy Sortable A during dragging (and recreate after drop) to disable dropping on Sortable A, so that draggables can only be dropped on Sortable B.

Attached patch checks for existence of oldParentNode before firing events on it. It fixes things for me.

Attachments

old_parent_node_might_not_exist.diff (1.3 kB) - added by kampers on 12/15/06 04:33:28.

Change History

12/15/06 04:32:52 changed by kampers

  • summary changed from [PATCH] oldParentNode might not exist if a Sortable's parent is destroy()'d to [PATCH] oldParentNode might not exist if a Draggable's parent is destroy()'d.

12/15/06 04:33:28 changed by kampers

  • attachment old_parent_node_might_not_exist.diff added.

06/18/07 01:51:08 changed by kampers

  • status changed from new to closed.
  • resolution set to untested.

You know, I ended up doing something different in my app, so this became unneeded. And I've got no tests for the fix.

If someone else has this issue and can produce some tests and an updated patch, feel free to reopen.