cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Heinicke (JIRA) <j...@apache.org>
Subject [jira] Commented: (COCOON-2167) Default value of validate attribute of submit widget has changed from true to false
Date Tue, 12 Feb 2008 01:41:08 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567915#action_12567915
] 

Jörg Heinicke commented on COCOON-2167:
---------------------------------------

Vadim committed it (http://svn.apache.org/viewvc?view=rev&revision=517843, only last two
files matter) with the following message: "submit widget was not inheriting validate attribute
from the library widget". I guess whatever the library widget had set was eventually ignored
and only the default value on the submit widget mattered if it actually did not have a validate
attribute.

So he added the above if check, but he also changed SubmitDefinition itself to set the default
value to true: 

--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java
2007/03/13 20:04:22	517842
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java
2007/03/13 20:09:32	517843
@@ -28,6 +28,11 @@
 
     private boolean validateForm;
 
+    
+    public SubmitDefinition() {
+        validateForm = true;
+    }
+
     /**
      * initialize this definition with the other, sort of like a copy constructor
      */

So unless the attribute is explicitly set to false everything should be fine.

Could it be that this change only slipped in when back-porting Vadim's concurrency fix, but
you forgot to back-port SubmitDefinition as well?

> Default value of validate attribute of submit widget has changed from true to false
> -----------------------------------------------------------------------------------
>
>                 Key: COCOON-2167
>                 URL: https://issues.apache.org/jira/browse/COCOON-2167
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.11
>            Reporter: Jörg Heinicke
>            Assignee: Jörg Heinicke
>
> http://marc.info/?l=xml-cocoon-dev&m=120277341318228&w=4
> Hello
> I noticed a change in behavior of cforms lately.  the submit widget now 
> has "false" as default value for the "validate" attribute (opposed to the 
> documenation which says, true is the default value). This really breaks 
> our application.  After backporting vadim's fixes for the concurrency bugs 
> we discovered to cforms 2.1.10, we also "migrated" this new behavior to 
> our cforms version.
> here is the code, which has an extra if statement in comparision to 
> 2.1.10.
> public final class SubmitDefinitionBuilder extends ActionDefinitionBuilder 
> {
>     public WidgetDefinition buildWidgetDefinition(Element widgetElement, WidgetDefinitionBuilderContext
context)
>     throws Exception {
>         SubmitDefinition definition = new SubmitDefinition();
>         setupDefinition(widgetElement, definition, context);
>         // parse "@validate"
>         if (widgetElement.hasAttribute("validate")) {
>             definition.setValidateForm(DomHelper.getAttributeAsBoolean(widgetElement,
"validate", true));
>         }
>         definition.makeImmutable();
>         return definition;
>     }
> }
> Is there any reason, why the behavior was changed and if it was a 
> accident, could someone revert the code inside the repos to the old 
> behavior?
> thanx alot!
> Gabriel

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message