Copied to clipboard

Flag this post as spam?

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


  • Hundebol 167 posts 314 karma points
    Aug 16, 2014 @ 13:50
    Hundebol
    0

    Tag Manager in v7 not allowing any actions

    Hi Nigel and others,

    Fantastic package this one, loved it in v4 and v6!
    Would like to use it in v7 as well, but I can seem to get it to work properly.

    The section is showing fine, and the tags are showing as well. 

    But clicking a tag does nothing. Tag name, tagged Content, tagged Media and merge tags are just empty. Save and delete are not working, and there is nothing showing in the pop-out menu.

    In the developer toolbar i get a network error saying "500 Internal Server Error" at a "DependencyHandler.axd" at "/umbraco/backoffice/TagManager/TagManagerAPI"

    Anyone having any idea what that might be. I have tried the package at both Umbraco 7.1.4 and the Alpha 7.2

    Best regards

  • Nigel Wilson 944 posts 2076 karma points
    Aug 17, 2014 @ 07:04
    Nigel Wilson
    0

    Hi Hundebol

    Thanks for your kind words - nice to know a simple wee package has been useful to you.

    Sorry to hear you've had some issues.

    Just an initial double check that all the files are present ?

    /bin/Yoyocms.Umbraco7.TagManager.dll
    /bin/NPoco.dll
    /App_Plugins/TagManager/package.manifest
    /App_Plugins/TagManager/TagManager.resource.js
    /App_Plugins/TagManager/backoffice/TagManagerTree/edit.controller.js
    /App_Plugins/TagManager/backoffice/TagManagerTree/edit.html

    Cheers
    Nigel 

  • Hundebol 167 posts 314 karma points
    Aug 17, 2014 @ 19:52
    Hundebol
    0

    Hi Nigel,

    It is very useful. So simple and yet so powerful.
    Actually I think stuff like this could just as well be in the core. 

    Anyways, I just doublechecked and all the files you mentioned are there. 
    I also tried installing on a totally clean version 7.1.4 - but still the same.

    The database is a SQl CE if that makes a difference.

    Any ideas?

  • Nigel Wilson 944 posts 2076 karma points
    Aug 17, 2014 @ 21:44
    Nigel Wilson
    0

    Hi Hundebol

    I haven't tried the package on a SQL CE database to be honest and with the error pointing to my API it may well be the NPOCO package I've used for the database interactions.

    I can't recall the exact file location but have you checked the log4net error logs to see if that provides any additional information - probably not as it is my code that is failing as opposed to the umbraco core code.

    It may be a week or two before I can get a chance to fully investigate the issue for you. Am more than happy to supply the source code for you to play with if you want (sorry, haven't put it in a repo at this stage).

    Cheers

    Nigel

  • Hundebol 167 posts 314 karma points
    Aug 18, 2014 @ 11:37
    Hundebol
    0

    Hi Nigel,

    I'm just a simple frontend developer, so source code would not help me out :)

    I'll just have to wait for you or some other developer who needs this.

    I just tried to have a look at log4net error logs, but could not really find anything useful in there.

    best regards

  • Dan 43 posts 72 karma points
    Oct 03, 2014 @ 12:45
    Dan
    1

    Hi. I'm testing this package on sqlce too and the error 500 when you click on a tag is ...

    If you are opensourcing it, I'd be happy to take a look and see if I can fix it :)

    {"Message":"An error has occurred.","ExceptionMessage":"There was an error parsing the query. [ Token line number = 3,Token line offset = 19,Token in error = SELECT ]","ExceptionType":"System.Data.SqlServerCe.SqlCeException","StackTrace":"   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)\r\n   at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()\r\n   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)\r\n   at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\\Code\\github\\SamSaffron\\MiniProfiler\\StackExchange.Profiling\\Data\\ProfiledDbCommand.cs:line 255\r\n   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()\r\n   at Umbraco.Core.Persistence.Database.<Query>d__7`1.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at Yoyocms.Umbraco7.TagManager.TagManagerAPIController.GetAllTagsInGroup(Int32 tagId)\r\n   at Yoyocms.Umbraco7.TagManager.TagManagerAPIController.GetTagById(Int32 tagId)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"}

  • Nigel Wilson 944 posts 2076 karma points
    Oct 05, 2014 @ 20:42
    Nigel Wilson
    0

    Hi Dan

    Sorry for the late response.

    My original codebase has an umbraco site wrapped up into the solution, so over the weekend I created a new VS solution with only the functionality included. 

    At this stage I haven't gotten the solution to build successfully so am working through that. Once sorted I will upload the code so you can access it.

    I'll be in touch.

    Cheers, Nigel

  • Dan 43 posts 72 karma points
    Oct 07, 2014 @ 14:34
    Dan
    0

    No worries. Thanks for the update.

  • Nigel Wilson 944 posts 2076 karma points
    Oct 11, 2014 @ 19:46
    Nigel Wilson
    0

    Hi Dan

    Source code for V7 is now (or is that finally !) uploaded.  :-)

    http://our.umbraco.org/projects/backoffice-extensions/tag-manager

    Keep me posted - [email protected]

    Cheers

    Nigel

  • Dan 43 posts 72 karma points
    Oct 14, 2014 @ 10:02
    Dan
    0

    Awesome sauce.

    I made a slight change to the sql query in GetAllTagsInGroup(int tagId)

    var query = new Sql().Select(string.Format("id, tag FROM cmsTags INNER JOIN (SELECT MAX(id) qId FROM cmsTags WHERE id={0}) t on cmsTags.id = t.qId ORDER BY tag", tagId));

    Seems to be working on my install now.

    Cheers Nigel

  • Dmitriy Larionov 10 posts 30 karma points
    Jan 16, 2015 @ 18:00
    Dmitriy Larionov
    0

    I found 2 problems for SQL CE :

    1. At line 57 part of SQL "[group] = (SELECT [group] FROM cmsTags WHERE id = {0})"" should have "IN" not "=" between "[group]" and "SELECT"

    2. In methods Save and DeleteTag used multiple sql statements in one query (divided by ";"). This lead to errors in SQLCE. I have rewritten it so:

    public int Save(cmsTags tag)
            {
                var db = UmbracoContext.Application.DatabaseContext.Database;

                int success = db.Execute("Update cmsTags set tag = @0 where id = @1", tag.tag, tag.id);

                if (success == 1 && tag.id != tag.tagsInGroup.selectedItem.id)
                {
                    // Merge tags, if still not merged
                    string sqlQuery1 = string.Format("Update cmsTagRelationship SET tagID = {0} WHERE tagID = {1} AND nodeId NOT IN (SELECT nodeId FROM cmsTagRelationship WHERE tagId = {0})", tag.tagsInGroup.selectedItem.id, tag.id);

                    success = db.Execute(sqlQuery1);

                    // Delete tag
                    if (success == 1)
                    {
                        string sqlQuery2 = string.Format("DELETE FROM cmsTagRelationship WHERE tagId = {0}", tag.id);

                        success = db.Execute(sqlQuery2);
                    }
                }

                return success;

            }

    public int DeleteTag(cmsTags tag)
            {

                var db = UmbracoContext.Application.DatabaseContext.Database;
                string sqlQuery1 = string.Format("DELETE FROM cmsTagRelationship WHERE tagId = {0};", tag.id);
                int success = db.Execute(sqlQuery1);

                if (success == 1)
                {
                    string sqlQuery2 = string.Format("DELETE FROM cmsTags WHERE id = {0};", tag.id);
                    success = db.Execute(sqlQuery2);
                }

                return success;
            }

    Still there is lot of things to fix, but at least something is working afer that.

  • Dmitriy Larionov 10 posts 30 karma points
    Jan 16, 2015 @ 22:20
    Dmitriy Larionov
    0

    I was not right.

            public int Save(cmsTags tag)
            {
                var db = UmbracoContext.Application.DatabaseContext.Database;

                int success = db.Execute("Update cmsTags set tag = @0 where id = @1;", tag.tag, tag.id);

                if (success == 1 && tag.id != tag.tagsInGroup.selectedItem.id)
                {
                    // Merge tags
                    string sqlQuery1 = string.Format("Update cmsTagRelationship SET tagID = {0} WHERE tagID = {1} AND nodeId NOT IN (SELECT nodeId FROM cmsTagRelationship WHERE tagId = {0});", tag.tagsInGroup.selectedItem.id, tag.id);

                    success = db.Execute(sqlQuery1);

                    // Delete tag
                    string sqlQuery2 = string.Format("DELETE FROM cmsTagRelationship WHERE tagId = {0};", tag.id);
                    db.Execute(sqlQuery2);
                }

                return success;

            }

     

            public int DeleteTag(cmsTags tag)
            {

                var db = UmbracoContext.Application.DatabaseContext.Database;
                string sqlQuery1 = string.Format("DELETE FROM cmsTagRelationship WHERE tagId = {0};", tag.id);
                db.Execute(sqlQuery1);

                string sqlQuery2 = string.Format("DELETE FROM cmsTags WHERE id = {0};", tag.id);
                int success = db.Execute(sqlQuery2);

                return success;
            }

        }

    3. You really don't need [AllowAnonymous] attribute for DeleteTag method. And it is dangerous.

    4. MoveTaggedNodes also requires to split one query to two:

            public int MoveTaggedNodes(int currentTagId, int newTagId)
            {
                var db = UmbracoContext.Application.DatabaseContext.Database;
               
                int success = db.Execute("Update cmsTagRelationship SET tagID = @1 WHERE tagID = @0 AND nodeId NOT IN (SELECT nodeId FROM cmsTagRelationship WHERE tagId = @1);", currentTagId, newTagId);

                if (success == 1)
                    success = db.Execute("DELETE FROM cmsTagRelationship WHERE tagId = @0;", currentTagId);

                return success;
            }

  • Dmitriy Larionov 10 posts 30 karma points
    Jan 16, 2015 @ 22:30
    Dmitriy Larionov
    0

    Nigel, i can send all fixed TagManagerAPIController.cs . I hope it would be good for community it you check it for your cases and update package.

    And, Nigel, thanks a lot for such a helpful package!

  • Nigel Wilson 944 posts 2076 karma points
    Jan 17, 2015 @ 19:51
    Nigel Wilson
    0

    Hi Dmitriy

    Thanks for your valuable feedback - truly appreciate it.

    I will update my code, run a few tests to ensure it all continues to work with a SQL dB and update the package repository.

    Cheers

    Nigel

  • Nigel Wilson 944 posts 2076 karma points
    Jan 22, 2015 @ 08:34
    Nigel Wilson
    0
  • Horst Sterr 171 posts 133 karma points
    Jun 20, 2015 @ 13:59
    Horst Sterr
    0

    Hi Nigel,

    running Umbraco version 7.2.5 and SQL CE and using V 3.2

    Having the same problems. No actions at all possible in the Tag Manager.

    Do you have any ideas for fixing this?

    Thank you, Horst

Please Sign in or register to post replies

Write your reply to:

Draft