Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@minotaur.apache.org Received: (qmail 23784 invoked from network); 10 Mar 2009 18:34:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2009 18:34:01 -0000 Received: (qmail 30191 invoked by uid 500); 10 Mar 2009 18:34:01 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 30151 invoked by uid 500); 10 Mar 2009 18:34:01 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 30142 invoked by uid 99); 10 Mar 2009 18:34:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 11:34:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 18:34:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BF7E3238896B; Tue, 10 Mar 2009 18:33:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r752208 - /incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java Date: Tue, 10 Mar 2009 18:33:40 -0000 To: sling-commits@incubator.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090310183340.BF7E3238896B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cziegeler Date: Tue Mar 10 18:33:38 2009 New Revision: 752208 URL: http://svn.apache.org/viewvc?rev=752208&view=rev Log: SLING-881 : if a property is updated and no type hint is sent from the client, use the current type of the property to update the value. Record delete change only if property has been deleted. Modified: incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java Modified: incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java?rev=752208&r1=752207&r2=752208&view=diff ============================================================================== --- incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java (original) +++ incubator/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java Tue Mar 10 18:33:38 2009 @@ -194,13 +194,19 @@ // ignore } } + final String[] values = prop.getStringValues(); + if ( type == PropertyType.UNDEFINED && values != null && values.length > 0 ) { + if ( parent.hasProperty(prop.getName()) ) { + type = parent.getProperty(prop.getName()).getType(); + } + } - String[] values = prop.getStringValues(); if (values == null) { // remove property - changes.add(Modification.onDeleted( - removePropertyIfExists(parent, prop.getName()) - )); + final String removePath = removePropertyIfExists(parent, prop.getName()); + if ( removePath != null ) { + changes.add(Modification.onDeleted(removePath)); + } } else if (values.length == 0) { // do not create new prop here, but clear existing if (parent.hasProperty(prop.getName())) {