Changeset 22680


Ignore:
Timestamp:
03/09/10 10:58:58 (17 months ago)
Author:
rns
Message:

Fix error when editing a constraint to/ from a subclass constraint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mnw21/pathquery_refactor/intermine/web/main/src/org/intermine/web/struts/QueryBuilderConstraintAction.java

    r22573 r22680  
    218218        } 
    219219        if ((oldConstraint != null) && (newConstraint != null)) { 
    220             query.replaceConstraint(oldConstraint, newConstraint); 
     220            // subclass constraints don't have a code but all other constraint types do 
     221            if (oldConstraint instanceof PathConstraintSubclass 
     222                    || newConstraint instanceof PathConstraintSubclass) { 
     223                query.removeConstraint(oldConstraint); 
     224                query.addConstraint(newConstraint); 
     225            } else { 
     226                query.replaceConstraint(oldConstraint, newConstraint); 
     227            } 
    221228        } else if (newConstraint != null) { 
    222229            query.addConstraint(newConstraint); 
Note: See TracChangeset for help on using the changeset viewer.