Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Adding tags to a file incorrectly adds a "tag_word" tag in addition to my tags #1636

Closed
emmaleisisw opened this issue Nov 21, 2014 · 2 comments
Labels

Comments

@emmaleisisw
Copy link

When I add tags to a File object, then update the file using FileService.updateCommunityFileMetadata, the file in Connections ends up with the tags I added along with a tag called "tag_word".
I'm assuming, but haven't checked, that the same happens with files outside communities.

This is caused by the following code in FileSerializer.getFileEntry():

if (entity.getTags()!=null)
    for (String tag : entity.getTags()) {
        appendChildren(n, textElement(CATEGORY, tag,                
            attribute(TERM, CATEGORY_TAG)
        ));
    }

The CATEGORY_TAG constant has the value "tag_word", which is the incorrectly added tag.

I think this comes from a misunderstanding of the Connections API documentation. The documentation says this represents a tag on a file:

    <category term="tag_word"/>

I think the intention is that "tag_word" is a placeholder, which the caller should replace with an actual tag in the term attribute, and the element shouldn't have any content.

What the current code does is send "tag_word" as the term attribute of every tag, with the real tag as content of the element. This has the effect of adding both the element content and "tag_word" as tags.

@prb112 prb112 added the bug label May 6, 2015
@prb112
Copy link
Contributor

prb112 commented May 13, 2015

which version of the toolkit are you using? are you using 1.1.3 or higher? I didn't get this from the fileserializer tests I added

@prb112
Copy link
Contributor

prb112 commented Nov 10, 2015

I believe this is previously fixed. If not, Scott, please let us know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants