Set tags not adding to cmsTags and cmsTagRelationShip tables
Using v7.15.4 and using tags set as csv and in content pre save event I am doing:
string tagPropertyAlias = Alert.GetModelPropertyType(x => x.ServiceNumber).PropertyTypeAlias;
if(content.HasProperty(tagPropertyAlias))
{
//its stored as json array but cannot get it back as array so have to use string manipulation
var serviceNumbers = content.GetValue<string>(tagPropertyAlias).Replace("[","").Replace("]","");
if (!string.IsNullOrEmpty(serviceNumbers) && serviceNumbers.Contains(","))
{
var badTags = serviceNumbers.Split(',');
List<string> goodTags = badTags.ToList();
//do we need to re add to tag manager??
content.SetTags(TagCacheStorageType.Csv,tagPropertyAlias,goodTags,true,"default");
}
}
So I have done it this way instead and it saves into content and it appears correctly in backoffice however the relation ships are not there, it seems as though set tags is not adding the relationships.
Set tags not adding to cmsTags and cmsTagRelationShip tables
Using v7.15.4 and using tags set as csv and in content pre save event I am doing:
I am doing this because I want users to be able to paste csv list of values see where if you do this then you get funny results see https://our.umbraco.com/forum/using-umbraco-and-getting-started/102387-cut-and-paste-many-tags .
So I have done it this way instead and it saves into content and it appears correctly in backoffice however the relation ships are not there, it seems as though set tags is not adding the relationships.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.