Skip to Content
1
May 29, 2018 at 12:02 PM

Backoffice: Multireference editor UI update response not working in 6.7

149 Views

Previously reported a problem with objectsUpdated not present in Hybris 6.3 (Expert Q Here) , now objectUpdated is removed completely and only objectsUpdated is left. This seems to be working in most cases but when using a MultiReference editor and editing the contained items in the popup dialog ("Edit details") then the objects in the model for the base object is not updated.

This is caused by the Objects.equals(currenctObject, updatedObject) but since updatedObject is passed as a collection now, this will ALWAYS be false.

 public class PyReferenceModelProperties extends DefaultReferenceModelProperties {
 
     @Override
     public void updateReferenceProperties(Set<String> referenceProperties, Object updatedObject, ObjectNotFoundExceptionHandler exceptionHandler) {
         if (updatedObject instanceof Collection) {
             final Collection<Object> updatedObjects = (Collection<Object>) updatedObject;
             updatedObjects.forEach(object -> super.updateReferenceProperties(referenceProperties, object, exceptionHandler));
         } else {
             super.updateReferenceProperties(referenceProperties, updatedObject, exceptionHandler);
         }
     }
 }

We solved this by replacing the bean for referenceModelProperties with the above class. Please also fix for next hybris release.