svn commit: r1858320 - in /ofbiz/ofbiz-framework/branches/release18.12: ./ applications/product/servicedef/services_feature.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1858320 - in /ofbiz/ofbiz-framework/branches/release18.12: ./ applications/product/servicedef/services_feature.xml

Swapnil M Mane
Author: swapnilmmane
Date: Sun Apr 28 11:57:08 2019
New Revision: 1858320

URL: http://svn.apache.org/viewvc?rev=1858320&view=rev
Log:
Applied fix from trunk for revision: 1858319
===

Fixed: createProductFeature service ignoring passed productFeatureId parameter
(OFBIZ-10958)

In the change, used override tag instead of attribute.
And set the optional true in INOUT mode for productFeatureId.
But since we are using entity-auto productFeatureId will be always available (either user provide it and if not passed by the user,  system will autogenerate it), thus it will be always OUT.

Additional Notes:

Here we can't make a changes mentioned below, because, for *optional* field's value, invokeCreate method (internally calling isIn and IsOut methods of ModelParam) of EntityAutoEngine.java consider the attribute (override) defined at last for parameters with the same name.

i.e. for below example,  optional value for productFeatureId for mode IN  will be false (but it is defined true)

{code}
<override name=productFeatureId type=String mode=IN optional=true/>
<override name=productFeatureId type=String mode=OUT optional=false/>
{code}

Due to this, isSinglePkIn (in invokeCreate method) field got false value, and the system will auto-generate the productFeatureId and ignore the user's input.

Similarly, we can't write in this way
{code}
<override name=productFeatureId type=String mode=OUT optional=false/>
<override name=productFeatureId type=String mode=IN optional=true/>
{code}

Because in this case, isSinglePkOut (in invokeCreate method) field got false value, and again the system will auto-generate the productFeatureId and ignore the user's input.

Thanks:  Ulrich Heidfeld for reporting the issue and providing the patch.

Modified:
    ofbiz/ofbiz-framework/branches/release18.12/   (props changed)
    ofbiz/ofbiz-framework/branches/release18.12/applications/product/servicedef/services_feature.xml

Propchange: ofbiz/ofbiz-framework/branches/release18.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Apr 28 11:57:08 2019
@@ -10,4 +10,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/ofbiz-framework/trunk:1849931,1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503,1852587,1852818,1852882,1853070,1853109,1853691,1853745,1853750,1854306,1854457,1854683,1855078,1855083,1855287,1855371,1855403,1855488,1855492,1855497,1855501,1855898,1856212,1856405,1856455,1856459-1856460,1856484,1856598,1856610,1856613,1856617,1856667,1857099,1857152,1857154,1857173,1857180,1857213,1857392,1857617,1857692,1857813,1858035,1858092,1858180,1858250,1858256,1858275
+/ofbiz/ofbiz-framework/trunk:1849931,1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503,1852587,1852818,1852882,1853070,1853109,1853691,1853745,1853750,1854306,1854457,1854683,1855078,1855083,1855287,1855371,1855403,1855488,1855492,1855497,1855501,1855898,1856212,1856405,1856455,1856459-1856460,1856484,1856598,1856610,1856613,1856617,1856667,1857099,1857152,1857154,1857173,1857180,1857213,1857392,1857617,1857692,1857813,1858035,1858092,1858180,1858250,1858256,1858275,1858319

Modified: ofbiz/ofbiz-framework/branches/release18.12/applications/product/servicedef/services_feature.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/applications/product/servicedef/services_feature.xml?rev=1858320&r1=1858319&r2=1858320&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/applications/product/servicedef/services_feature.xml (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/applications/product/servicedef/services_feature.xml Sun Apr 28 11:57:08 2019
@@ -43,7 +43,7 @@ under the License.
     <service name="createProductFeature" engine="entity-auto" invoke="create" default-entity-name="ProductFeature" auth="true">
         <description>Create a ProductFeature record</description>
         <auto-attributes include="all" mode="IN" optional="true"/>
-        <attribute name="productFeatureId" type="String" mode="OUT" optional="false"/>
+        <override name="productFeatureId" type="String" mode="INOUT" optional="true"/>
         <override name="productFeatureTypeId" mode="IN" optional="false"/>
         <override name="description" mode="IN" optional="false"/>
     </service>