[Suiviobsmer-commits] r680 - in branches/wao-1.5.x: . src/announcement wao-business wao-ui wao-ui/src/main/java/fr/ifremer/wao/ui/pages
Author: fdesbois Date: 2010-10-15 16:11:20 +0000 (Fri, 15 Oct 2010) New Revision: 680 Log: ANO #2540 : NPE on old contact state when validate unfinished contact for program. Added: branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt Modified: branches/wao-1.5.x/changelog.txt branches/wao-1.5.x/pom.xml branches/wao-1.5.x/wao-business/pom.xml branches/wao-1.5.x/wao-ui/pom.xml branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java Modified: branches/wao-1.5.x/changelog.txt =================================================================== --- branches/wao-1.5.x/changelog.txt 2010-10-15 15:33:29 UTC (rev 679) +++ branches/wao-1.5.x/changelog.txt 2010-10-15 16:11:20 UTC (rev 680) @@ -3,6 +3,15 @@ Historique des versions +1.5.4 +----- + +Anomalies ++++++++++ + +- [fdesbois] Ano #2540 : La validation programme ne fonctionne plus sur un contact + refusé. + 1.5.3 ----- Modified: branches/wao-1.5.x/pom.xml =================================================================== --- branches/wao-1.5.x/pom.xml 2010-10-15 15:33:29 UTC (rev 679) +++ branches/wao-1.5.x/pom.xml 2010-10-15 16:11:20 UTC (rev 680) @@ -15,7 +15,7 @@ <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>1.5.3</version> + <version>1.5.4-SNAPSHOT</version> <modules> <module>wao-ui</module> Added: branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt =================================================================== --- branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt (rev 0) +++ branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt 2010-10-15 16:11:20 UTC (rev 680) @@ -0,0 +1,20 @@ + +Un correctif 1.5.4 pour la version 1.5 de Wao est disponible. + +Résolution d'anomalies : + +- La validation programme ne fonctionne plus sur un contact refusé. + [fdesbois-Ano #2540] + +Documentation : + +http://suiviobsmer.labs.libre-entreprise.org/wao/ + +Téléchargement : + +https://labs.libre-entreprise.org/frs/?group_id=154 + +Cordialement, + +L'équipe Wao + Modified: branches/wao-1.5.x/wao-business/pom.xml =================================================================== --- branches/wao-1.5.x/wao-business/pom.xml 2010-10-15 15:33:29 UTC (rev 679) +++ branches/wao-1.5.x/wao-business/pom.xml 2010-10-15 16:11:20 UTC (rev 680) @@ -10,7 +10,7 @@ <parent> <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>1.5.3</version> + <version>1.5.4-SNAPSHOT</version> </parent> <groupId>fr.ifremer.wao</groupId> Modified: branches/wao-1.5.x/wao-ui/pom.xml =================================================================== --- branches/wao-1.5.x/wao-ui/pom.xml 2010-10-15 15:33:29 UTC (rev 679) +++ branches/wao-1.5.x/wao-ui/pom.xml 2010-10-15 16:11:20 UTC (rev 680) @@ -10,7 +10,7 @@ <parent> <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>1.5.3</version> + <version>1.5.4-SNAPSHOT</version> </parent> <groupId>fr.ifremer.wao</groupId> Modified: branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-10-15 15:33:29 UTC (rev 679) +++ branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-10-15 16:11:20 UTC (rev 680) @@ -684,29 +684,21 @@ " du jour"); } - if (logger.isDebugEnabled()) { - logger.debug("IsUnfinished : " + contactState.isUnfinishedState()); - logger.debug("OldUnfinished : " + oldState.isUnfinishedState()); - - String newComment = contactEdited.getComment(); - boolean commentDefined = StringUtils.isNotEmpty(newComment); - boolean commentChanged = commentDefined && !newComment.equals(oldComment); - - logger.debug("commentDefined : " + commentDefined); - logger.debug("commentChanged : " + commentChanged); - } - // Non abouti, Refus ou Refus Définitif if (contactState.isUnfinishedState()) { String newComment = contactEdited.getComment(); - boolean commentChanged = - StringUtils.isNotEmpty(newComment) && + boolean commentDefined = StringUtils.isNotEmpty(newComment); + boolean commentChanged = commentDefined && !newComment.equals(oldComment); + // Ano #2540 : NPE on oldState, extract boolean for + // previous unfinishedState case + boolean previousUnfinishedState = commentDefined && + oldState != null && oldState.isUnfinishedState(); + // Ano #2440 : no restriction if previous state is unfinished - if (oldState.isUnfinishedState() && - StringUtils.isNotEmpty(newComment) || commentChanged) { + if (previousUnfinishedState || commentChanged) { // RAZ des champs contactEdited.setTideBeginDate(null); @@ -715,6 +707,7 @@ contactEdited.setMammalsCapture(false); contactEdited.setMammalsObservation(false); contactEdited.setDataInputDate(null); + } else { contactsForm.recordError(comment, "Vous devez ajouter" + " un commentaire pour l'état" +
participants (1)
-
fdesbois@users.labs.libre-entreprise.org