cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unexpected behaviour for Product relation, using modifier partof="true"

Former Member
1,062

Hi, I'm having some unexpected issues after migrating hybris to version 6.7. The following is a relation between Product and AvailableUnit item types:

 <relation code="Product2AvailableUnit" localized="false">
     <sourceElement type="Product" cardinality="one" qualifier="product"/>
     <targetElement type="AvailableUnit" cardinality="many" qualifier="availableUnits" collectiontype="set">
         <modifiers partof="true"/>
     </targetElement>
 </relation>

On its own this relation works fine. The availableUnits for product get synchronized between products different catalog version. The issue occurs when I add a dynamic attribute of type AvailableUnit.

 <itemtype code="Product" autocreate="false" generate="false">
     <attribute qualifier="warehouseUnit" type="AvailableUnit">
         <persistence type="dynamic" attributeHandler="productWarehouseUnitDynamicAttributeHandler"/>
     </attribute>
 </itemtype>

Whit this dynamic attribute added, when synchronizing the product catalog versions I get the following exception:

 ERROR [SyncWorker<00000GZ5 16 of 16>] [AbstractItemCopyContext] error setting partOf attribute warehouseUnit : no attribute AvailableUnit.availableUnits found
 de.hybris.platform.jalo.JaloSystemException: no attribute AvailableUnit.availableUnits found[HY--1]
     at de.hybris.platform.jalo.Item.getAccessorFor(Item.java:1218)

AvailableUnit does not, and is not supposed to have an attribute "availableUnits", only product has it. If I remove the modifier "partof=true" part, then I do not get this sync exception, but then also available units just aren't getting synchronized between different product catalog versions.

I have tried various things, such as running ant clean all, running initialize through hac, but I'm always getting the same exception. I believe I didn't have this issue with Hybris 6.6, and everything was working just fine. Any suggestions? Is this a hybris bug? Additionally, here's item definition for available unit:

     <itemtype code="AvailableUnit" >
         <deployment table="AvailableUnit" typecode="20007"/>
         <attributes>
             <attribute qualifier="unit" type="Unit">
                 <persistence type="property"/>
                 <modifiers optional="false" initial="true"/>
             </attribute>
             <attribute qualifier="baseUnit" type="Unit">
                 <persistence type="property"/>
                 <modifiers optional="false" initial="true"/>
             </attribute>
             <attribute qualifier="denominator" type="java.lang.Integer">
                 <persistence type="property"/>
                 <modifiers optional="false"/>
                 <defaultvalue>1</defaultvalue>
             </attribute>
             <attribute qualifier="numerator" type="java.lang.Integer">
                 <persistence type="property"/>
                 <modifiers optional="false"/>
                 <defaultvalue>1</defaultvalue>
             </attribute>
         </attributes>
     </itemtype>

Accepted Solutions (0)

Answers (1)

Answers (1)

bughunter_af
Explorer
0 Likes

Hello Herberts

I just ran into the same problem on 1808. Did you find a solution?

Cheers

Former Member
0 Likes

Sadly no,
looking at the code now, we just ended up removing the "partof" modifier and changing the relation to many-to-many.