We're updating the issue view to help you get more done. 

Issue in batch editing of relationship fields

Description

We are facing an issue while performing batch editing in Collective Access (Providence) version 1.6.1. When using ‘Remove All Values’ option for a relationship field, it remove all relationships for all fields, instead of that specific field.
For example, for one of our Object, we have defined three relationships with three different kinds of Entities.
Object has a relationship with a Holding Institute
Object has a relationship with an Author.
Object has relationship with a Composer.

Holding Institutes, Authors and Composers are three ‘different types’ of Entities.
While performing batch editing to ‘Remove All Values’ for Holding Institute relationship, all other relationships with entities are removed. That is, all Author and Composer relationships are removed as well. In principle, only Holding Institute relationships should be removed.

Apparently, it is happening because of lack of relationship type in function call ‘removeRelationships’ in function ‘_processRelate’ of class ‘BundlableLabelableBaseModelWithAttributes’. See the attached file.

A similar problem occurs when replacing a relationship field value in batch editing. It replaces the required value correctly, however it removes values for all other relationships.
For example, replacing the value of Holding Institute will replace its value correctly, however relationships Author and Composer are removed altogether.
It seems cause for this issue is similar to the one mentioned earlier. No relationship type provided in the function call ‘removeRelationships’. This causes all relationships to be removed before new relationships are added. See the attached file.

Fix for these issues will be of great help as we quite often need to perform batch editing.

Thanks.

Environment

CentOS Linux release 7.1.1503
PHP Version 5.6.18

Assignee

User known

Reporter

Naeem Muhammad

Labels

None

Fix versions

Affects versions

Priority

Major
Configure