Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Derrik 29 posts 98 karma points
    Oct 23, 2012 @ 17:31
    Derrik
    0

    tags data type not working

    I've added the Tags data type to my doc type and it works the first time I add a tag to the field, but after saving and publishing I can not add more tags or remove the tags. When I type in a new tag, it shows up in the field but when I save and publish it is gone. I can also delete a tag from the field, but when I save and publish it reappears.

    If I go to the Tags data type and click save, I can go back to the node and add/remove tags once more. But after I save and publish the node, it is broken again.

    I'm seeing this issue on two separate 4.9 installations. Any ideas?

  • Derrik 29 posts 98 karma points
    Oct 23, 2012 @ 17:52
    Derrik
    0

    Apparently others have run in to this as well. I found a video from Bo Mortensen demoing the issue: http://www.screenr.com/w3i8

  • Matt Watson 33 posts 55 karma points
    Oct 31, 2012 @ 13:42
    Matt Watson
    0

    This has been added as a bug here: http://issues.umbraco.org/issue/U4-915#

    Everyone in the world, please log in and vote it up ;)

  • Matt Watson 33 posts 55 karma points
    Oct 31, 2012 @ 13:43
    Matt Watson
    0

    Just to add to this, its also in my 4.9.1 instance

  • Matt Watson 33 posts 55 karma points
    Oct 31, 2012 @ 16:59
    Matt Watson
    0

    Right! I've come up with a fix. In the source code at: \umbraco_8d7d8609e2e4\src\umbraco.editorControls\tags edit the file DataEditor.cs.

    The code block that says: 

                string tagsAutoCompleteScript =

                    "jQuery('.umbTagBox').tagsInput({ width: '400px', defaultText: 'Add a tag', minChars: 2, autocomplete_url: '" +

                    umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)

                    + "/webservices/TagsAutoCompleteHandler.ashx?group=" + _group + "&id=" + pageId + "&rnd=" +

                    DateTime.Now.Ticks + "&format=json' });";

     

    Change this to:

                string tagsAutoCompleteScript =

                    "jQuery('#" + tagBox.ClientID + "').tagsInput({ width: '400px', defaultText: 'Add a tag', minChars: 2, autocomplete_url: '" +

                    umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)

                    + "/webservices/TagsAutoCompleteHandler.ashx?group=" + _group + "&id=" + pageId + "&rnd=" +

                    DateTime.Now.Ticks + "&format=json' });";

     

    The key point is that the jQuery needs to work against a single ID, not against the class, otherwise it will fire the jQuery function for every instance of .umbTagBox on your page. If you have multiple tags it will show multiple boxes, and it also stops you being able to save on post back (I guess because it doesn't know which instance you are saving from).

    I will be submitting a pull back to core, which will hopefully be in 4.10. In the mean time I have attached the fixed dll to the following issue log that you can use: http://issues.umbraco.org/issue/U4-915

    Let me know if there are any problems :)

  • Derrik 29 posts 98 karma points
    Nov 06, 2012 @ 21:25
    Derrik
    0

    Hey Matt,

    Thanks for looking in to this. I used your updated DLL and I thought it was working, but then the issues started popping up again. See my video: http://www.screenr.com/Hz87

    I can't save or delete tags properly. Sometimes all of the tags get removed entirely and sometimes they are duplicated. If I go back to the data type and click save, the tags temporarily work again.

    These issues also exist when there is only a single tag data type on the document, but I used two in the example to show the duplication issue still exists.

    This was tested in 4.9.1 and 4.10.0 RC.

    I also posted this to your bug report. http://issues.umbraco.org/issue/U4-915#comment=67-3524

     

Please Sign in or register to post replies

Write your reply to:

Draft