Bug 1007629

Summary: Assigned tags disappear from UI view when remove an assigned tag from the same project+category
Product: [Community] PressGang CCMS Reporter: mmurray
Component: Web-UIAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact: mmurray
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: lnewson
Target Milestone: ---   
Target Release: 1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 23:49:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mmurray 2013-09-13 02:18:10 UTC
Description of problem:
'Remove' button appears to remove all tags corresponding to the same project+category not just the tag corresponding to the specific 'Remove' button. Subsequently trying to readd tags that shouldn't have been removed gives an error message and indicates that the UI is showing the incorrect info.


Version-Release number of selected component (if applicable):
Build 201309081012
Build 201309131104 (Next)


How reproducible:
100% until save some new tag changes and then seems to be fixed?


Steps to Reproduce:
1. Pick a content spec with Release tag already assigned (e.g., id 22434).
2. Click Tag tab.
3. Add another Release tag (e.g., JBDS 7.0.0 - frozen) > tag is added, all good
4. Remove original Release tag (e.g., JBDS 7.0.z) > both tags appear to be removed
5. Try to re add desired Release tag (JBDS 7.0.0 - frozen) > message 'The tag was not added because it is already assigned to the topic.'
6. Try to re add original Release tag (JBDS 7.0.z)  > both tags are listed again

Also:
1. Pick a content spec with Release tag already assigned (e.g., id 22433).
2. Click Tag tab.
3. Remove original Release tag > tag is removed, all good
4. Add a new Release tag > nothing appears to happen

Can also reproduce with Book tag.

Conditions under which error occurs:
content spec must have tags assigned already (+ have been saved)
+ add a tag from a project+category that already has a tag assigned 
+ remove original tag from that same project+category


Potential work around:
Add new tag, save, and then remove original tag

Comment 1 Lee Newson 2013-09-13 02:32:05 UTC
The first part is not a bug and is just how the data is displayed (it needs reworking to be honest), as a Tag is assigned to a Topic. When it is presented however it's starting point is a "Project", which is just a grouping and a tag can belong to multiple projects. So when you remove a tag you are going to remove the singular instance from the topic but it'll disappear from the UI for all matching projects.

As for the other part I can reproduce it and again it's relevant to both Topic and Content Spec views.

Comment 2 mmurray 2013-09-13 02:43:13 UTC
Lee, I'm not following what you mean by first/second part? Is this corresponding to the 'steps to reproduce' (first part?) and 'also' (second part?) text? I might not have written the description correctly as to me the two examples (steps to reproduce + also) look like the same underlying issue.

Comment 3 Lee Newson 2013-09-13 03:06:43 UTC
Hey Michelle,

Sorry ignore the first part it was a misunderstanding of the description on my part.

For what it's worth I was referring to, say having the "Hibernate" tag which is included in three projects, as such it shows up three times in the Tags view, however removing anyone of those will remove all three (since they are really the same entity)

Comment 4 Lee Newson 2013-09-16 01:37:06 UTC
Fixed in Build 201309161122.

This was caused by using the equals method on the RESTProjectV1 class, however it takes into account revision and id. However in this instance we are only interested in the id and not the revision, as such I've fixed it so that it checks if the project using a mechanism that only checks against the id.

Note: This version is currently live on the PressGang Next instance.

Comment 5 mmurray 2013-09-16 04:50:19 UTC
Fix verified for content specs + topics in Build 201309161122.

Comment 6 Lee Newson 2013-09-16 04:51:30 UTC
Thanks Michelle