Trails

Editing a child object from a indexed list "child" collection creates duplicates.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1.0
  • Labels:
    None
  • Number of attachments :
    0

Description

If the child collection is an indexed list when you edit a child object and go back to its parent the object gets added to the list twice, in fact is more than twice, it gets added to the list every time you edit it.

This bug does not affect Trails 1.0 or Sets, and if you are using a non indexed list the bug may not seem too big.

To see the bug in action, lunch the "simple" example, edit a catalog and then add categories to it.

Activity

Hide
Alejandro Scandroli added a comment -

a workaround (from the user's point of view) is to use an "add" method

public void addCategory (Category category) {
		if (!getCategories().contains(category)) {
			getCategories().add(category);
		}
	}

Trails will automagically detect that this method exists and it will use it for adding child objects to the collection.

Show
Alejandro Scandroli added a comment - a workaround (from the user's point of view) is to use an "add" method
public void addCategory (Category category) {
		if (!getCategories().contains(category)) {
			getCategories().add(category);
		}
	}
Trails will automagically detect that this method exists and it will use it for adding child objects to the collection.
Hide
Alejandro Scandroli added a comment -

fixed in svn rev 739

Show
Alejandro Scandroli added a comment - fixed in svn rev 739

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: