Bug reports Found a bug? Post it here please.
Version 7.x > Bug reports > CurrentDocument.Tags : Possible versioning bug ? View modes: 
User avatar
Member
Member
@davey_lad - 9/11/2013 9:18:22 AM
   
CurrentDocument.Tags : Possible versioning bug ?
Hi,

I'm using a workflow with Versioning and I've noticed that Document Tags returned by CurrentDocument.Tags include any "new" tags that may be added to an existing document that is currently not yet published.

Example :

Document V1.0 Tags : "tag1, tag2"
Status: Published
Expected : CurrentDocument.Tags returns "tag1, tag2"
Actual: CurrentDocument.Tags returns "tag1, tag2"

When the same document is checked out and tags edited :
Document V1.1 Tags : "tag1, tag2, tag3, tag4"
Status: Saved/Checked In/Not Published
Expected : CurrentDocument.Tags returns "tag1, tag2"
Actual: CurrentDocument.Tags returns "tag1, tag2, tag3, tag4"

In this case I would expect CurrentDocument.Tags to still only return "tag1, tag2" until V1.1 is Published.

All other fields (content) accessed on CurrentDocument return the correct value i.e. the value stored againt the currently published version (e.g. V1.0). I believe this behaviour should be the same for Tags.

Can someone confirm this as a bug or explain why the behaviour is different?

Hope this makes sense

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/11/2013 9:29:46 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
Hello,

As first, could you please tell us what exact version are you running at the moment? Do you have the latest hotfix installed? If no, please apply the latest hotfix to see if it will resolve this issue. I know about one related tag bug which was already fixed in version 7.

Best Regards,
Martin Danko

User avatar
Member
Member
@davey_lad - 9/11/2013 9:44:01 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
Hi Martin,

I'm currently running version 7.0.32

I'm unable to apply the latest hotfix at this time as the client is also running this version and has a rigid update/deployment process policy for software updates etc.

I have however looked through all of the release notes from hotfix 32 up to the latest and haven;t noticed anything related to Tags

User avatar
Member
Member
@davey_lad - 9/11/2013 9:51:22 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
For what it's worth.. I have been able to retrieve the desired information using the code snippet below. However, I do believe it should be possible to just retreive this information from CurrentDocument object.

private string getPublishedTags()
{
VersionHistoryInfo vhi = VersionHistoryInfoProvider.GetVersionHistoryInfo(CurrentDocument.DocumentPublishedVersionHistoryID)
DataSet ds = DataHelper.GetDataSetFromXml(vhi.NodeXML);
if (!DataHelper.DataSourceIsEmpty(ds))
{
return ValidationHelper.GetString(ds.Tables[0].Rows[0]["DocumentTags"], null);
}
return CurrentDocument.GetStringValue("DocumentTags", null);
}

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/20/2013 3:59:16 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
Hi Davey,

Thank you for sharing code snippet. Yes, it's kind of workaround but this behaviour is caused by the design of the application. However it works, it's not the right way from developers perspective because you are getting the tags from the document field but these tags are also stored in the separated DB table CMS_DocumentTag so it will require more complex changes, our developers already know about it and they have planned a refactoring of this part too.... and the same applies to categories.

Best regards,
Martin Danko

User avatar
Member
Member
@davey_lad - 9/20/2013 8:20:18 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
OK, thanks for looking into it.

Will this be issued as a hotfix? If so is there any ETA ?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/23/2013 1:43:13 AM
   
RE:CurrentDocument.Tags : Possible versioning bug ?
Hi Davey,

unfortunately this won't be fixed in the hotfix for version 7. Depends on the time if the Development team will have to change this functionality for version 8 because at the moment the Tags doesn't support any kind of versioning.I'm very sorry for this inconvenience.

Best regards,
Martin Danko