Copied to clipboard

Flag this post as spam?

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


  • Fredrik Esseen 590 posts 806 karma points
    Jan 07, 2010 @ 16:07
    Fredrik Esseen
    0

    Tags not working correctly?

    I created a post about this some time ago and it never got solved so I waited for the new blog to see if it should be gone, but nope.

    The problem is: When i write something in the tag textfield I see three words: jaxx,pik,hat. Its a clean installation and I never wrote these words before. I know more people than I have this problem. I also got an empty tag that I cant remove.

    I use MySQL and Umbraco 4.0.2.1

  • Sebastiaan Janssen 4880 posts 14554 karma points MVP admin hq
    Jan 07, 2010 @ 17:46
    Sebastiaan Janssen
    0

    I think you might have used these words in a textbox somewhere else on the web, your browser's autocomplete fills them in for you.

    The empty tag is a bit annoying, but can be removed by unchecking it, saving the document and then maybe you have to re-open the document (I'm not sure). Re-open by clicking another node and then click back to the one you were editing.

  • Fredrik Esseen 590 posts 806 karma points
    Jan 08, 2010 @ 13:01
    Fredrik Esseen
    0

    No, that is not the problem. I looked at different computers and different customers and they all have the same problem.
    Is it related to MySQL somehow? As I said, Im not the only one with this problem.

    Is the empty tag something that everyone have a problem with?

  • Thomas Kahn 602 posts 506 karma points
    Jan 10, 2010 @ 11:17
    Thomas Kahn
    0

    I took a quick look at the overloaded WebMethod getTagList public string[] getTagList(string prefixText, int count, string contextKey)  in the class tagService and found this hardcoded into the method:

    return ("jaxx,pik,hat").Split(',');

    To me it looks like temporary testing code that has not been deleted?

    Regards,
    Thomas Kahn

  • Thomas Kahn 602 posts 506 karma points
    Jan 10, 2010 @ 11:29
    Thomas Kahn
    0

    Looking a bit closer at the method, I see that the line of code that returns these three words (jaxx,pik,hat) it looks like it's only activated if the try/catch fails? If the try/catch is successful, this line of code should return the correct value:

    return result.Trim(',').Split(',');

    There are also several lines of code that write Debug entries into the umbraco log so perhaps this method is not really finished yet?

    /Thomas K

  • bayshield 50 posts 65 karma points
    Jan 10, 2010 @ 19:43
    bayshield
    0

    I have also just found a problem with the tags.  Quite often when I type a tag and press 'Enter'  I wil get two tags created, one of which is empty.  In addition, if I add a tag and then unselect it, it is still showing up in the list of categories.

    If you have a look at my blog (http://www.bayshield.com) I did a post which I tagged as .Net and then changed to be ASP.Net.  If you click on the '.Net' category on the right menu it will display the article, however scrolling to the bottom will show that .Net is not a tag for the selected article.

    How do I permanently remove a tag?  I don't quite understand at the moment where the data is being created or how else it can be modified.

    Thanks

     

     

     

  • Timsn 121 posts 231 karma points
    Jan 10, 2010 @ 22:09
    Timsn
    0

    The tags of a blog post are stored in one single attribute called tags. And the xslt just looks if the given filter (.NET in your case) is contained in this attribute.

    If you have a post which is tagged with ASP.NET and you filter for .NET, all posts containing .NET in their tags are displayed.
    So your post isn't tagged with .NET anymore but because ASP.NET contains .NET it is still shown. That's because of this line in the BlogListPosts.xslt:

    <xsl:for-each select="$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'Blog']//node [@nodeTypeAlias = 'BlogPost' and contains(Exslt.ExsltStrings:lowercase(./data [@alias='tags']), Exslt.ExsltStrings:lowercase($filter))]">

    If you want to remove a tag permanently you have to do into the database and delete it. The tags are stored in the cmsTags table.

  • Fredrik Esseen 590 posts 806 karma points
    Jan 11, 2010 @ 10:01
    Fredrik Esseen
    0

    This is how it looks if I try to add a tag.

    Ive added a tag so it should return a value? It seems it doesnt retrieve any tags at all?

  • Fredrik Esseen 590 posts 806 karma points
    Jan 11, 2010 @ 10:04
    Fredrik Esseen
    0
  • Ismail Mayat 4489 posts 10011 karma points MVP 2x admin c-trib
    Jan 11, 2010 @ 10:08
    Ismail Mayat
    3

    Guys,

    I am working on a tag manager dashboard control, I have upcoming project where i will be doing quite a bit of tagging and thus needed admin interface to edit/update tags, will upload to projects when i get a chance.

    Regards

    Ismail

  • Ismail Mayat 4489 posts 10011 karma points MVP 2x admin c-trib
    Jan 11, 2010 @ 17:54
    Ismail Mayat
    0

    I have created tag dashboard you can download it here http://our.umbraco.org/projects/tagmanager

    Regards

    Ismail

  • Fredrik Esseen 590 posts 806 karma points
    Jan 12, 2010 @ 11:38
    Fredrik Esseen
    0

    Im quite sure now that the connection between the function that retrieves the tags and the db somehow is not working. The tags are registered in the db but never shows up in the textfield.

    It seems that, as Thomas Kahn says that the try/catch fails. Why?

  • Sebastiaan Janssen 4880 posts 14554 karma points MVP admin hq
    Jan 13, 2010 @ 16:12
    Sebastiaan Janssen
    0

    Weird stuff..

    Try and have a look in the windows event log, or the umbracoLog table to see what might be going wrong.

  • Fredrik Esseen 590 posts 806 karma points
    Jan 15, 2010 @ 16:40
    Fredrik Esseen
    0

    I think I've found the problem. I checked the UmbracoLog as suggested and saw this:

    umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteReader ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '20 TAG FROM CMSTAGS WHERE TAG LIKE 'ddd%' AND CMSTAGS.ID NOT IN
                  ' at line 1
       at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
       at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
       at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
       at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlHelper.ExecuteReader(MySqlConnection connection, MySqlTransaction transaction, String commandText, MySqlParameter[] commandParameters, Boolean ExternalConn)
       at MySql.Data.MySqlClient.MySqlHelper.ExecuteReader(String connectionString, String commandText, MySqlParameter[] commandParameters)
       at umbraco.DataLayer.SqlHelpers.MySql.MySqlHelper.ExecuteReader(String commandText, MySqlParameter[] parameters) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\datalayer\SqlHelpers\MySql\MySqlHelper.cs:line 81
       at umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\datalayer\SqlHelper.cs:line 240
       --- End of inner exception stack trace ---
       at umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\datalayer\SqlHelper.cs:line 244
       at umbracoTags.webservice.tagService.getTagList(String prefixText, Int32 count, String contextKey)

     

    Seems there is some problem with MySQL compability?

  • Fredrik Esseen 590 posts 806 karma points
    Jan 18, 2010 @ 08:48
    Fredrik Esseen
    1

    Detailed solution:

    tagService.asmx.cs is not MySQL compatible. The Sql queries contains TOP which is specific for MSSql and not compliant with MySql.

     sql = @"SELECT TOP 20 tag FROM cmsTags WHERE tag LIKE @prefix AND cmsTags.id not in 
                            (SELECT tagID FROM cmsTagRelationShip WHERE NodeId = @nodeId) AND cmstags.[group] = @group;";
    

    Workitem created at codeplex: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=25970

     

  • Sebastiaan Janssen 4880 posts 14554 karma points MVP admin hq
    Jan 18, 2010 @ 09:34
    Sebastiaan Janssen
    0

    Glad you found the issue! Voted it up at Codeplex.

  • Jan Kees Velthoven 25 posts 46 karma points
    Oct 05, 2011 @ 09:12
    Jan Kees Velthoven
    0

    Can anyone tell me what the status is of this issue? I'm having the same error using the Open Calais Autotag package.

  • Jan Kees Velthoven 25 posts 46 karma points
    Oct 05, 2011 @ 09:32
  • Rob Watkins 343 posts 593 karma points
    Feb 09, 2012 @ 14:13
    Rob Watkins
    0

    This still seems to be an issue in the latest release; it is pretty easy to patch to get the autocomplete working though, I have included how to do it here in case it is useful for anyone else - doesn't require Visual Studio, or any rebuilding of core code - just a text editor!

    1. Get the file TagsAutoCompleteHandler.ashx.cs from here:

    http://umbraco.codeplex.com/SourceControl/changeset/view/0e89dd08ccd5#umbraco%2fpresentation%2fumbraco%2fwebservices%2fTagsAutoCompleteHandler.ashx.cs

    2. This is going to be a patch, not a fix, so give the class a new name, so the line:

     

    public class TagsAutoCompleteHandler : IHttpHandler 

    ...becomes:

     

    public class TagsAutoCompleteHandler_MySQL : IHttpHandler

    Fixing the SQL is very straightforward; in BOTH of the two queries remove the TOP (20) and put LIMIT 20 on the end, so for example the shorter (fallback) query changes from:

    sql = "SELECT TOP (20) tag FROM cmsTags WHERE tag LIKE @prefix";

    ...to become:

    sql = "SELECT tag FROM cmsTags WHERE tag LIKE @prefix LIMIT 20";

    Remember to do both!

    3. The magic bit: save this file as TagsAutoCompleteHandler_MySQL.ashx.cs in the /App_Code folder. The App_Code folder, if you don't use it (I only discovered it recently, yes, yes, I know) will cause ASP.NET to automatically compile anything in it and create an assembly; basically it means you can use the class as if it were compiled and uploaded into the /bin folder simply by uploading source code. It's incredibly useful for doing these quick patches.

    4. Now, edit /umbraco/webservices/TagsAutoCompleteHandler.ashx to refer to the new class - so it should now contain:

    <%@ WebHandler Language="C#" CodeBehind="TagsAutoCompleteHandler_MySQL.ashx.cs" Class="umbraco.presentation.umbraco.webservices.TagsAutoCompleteHandler_MySQL" %>

    This is too long for my screen, so it hides the important bit, which is changing the Class attribute to your new class umbraco.presentation.umbraco.webservices.TagsAutoCompleteHandler_MySQL

    5. Now go in the admin system (I refreshed but you shouldn't need to) and all the tag datatypes will have their autocompletes back. Ta da!

     

  • Rob Watkins 343 posts 593 karma points
    Feb 09, 2012 @ 14:21
    Rob Watkins
    0

    Sorry for terrible formatting, I wish the Umbraco peeps would use the StackOverflow editor :o)

  • Sean Dooley 268 posts 485 karma points
    Mar 20, 2012 @ 17:37
    Sean Dooley
    0

    Followed the post from Rob Watkins. I am getting the following error

    Could not create type 'umbraco.presentation.umbraco.webservices.TagsAutoCompleteHandler_MySQL'

    Any ideas?

  • Rob Watkins 343 posts 593 karma points
    Mar 20, 2012 @ 17:46
    Rob Watkins
    0

    Sounds like it's not compiling the new class correctly, I assume you've eliminated silly possibilities like typos / syntax errors? 

    Erm, I can't really think of anything else. Where is this message happening? 

  • Sean Dooley 268 posts 485 karma points
    Mar 21, 2012 @ 12:12
    Sean Dooley
    0

    I copy TagsAutoCompleteHandler.ashx.cs into the App_Code folder in Visual Studio 2010. Changing the file and class name to TagsAutoCompleteHandler_MySQL.

    The following errors appear in Visual Studio (probably explain the issue)

     

    • The type or namespace name 'DataLayer' does not exist in the namespace 'umbraco' (are you missing an assembly reference?)
    • The type or namespace name 'BusinessLogic' does not exist in the namespace 'umbraco' (are you missing an assembly reference?)
    • The type or namespace name 'IRecordsReader' does not exist in the namespace 'umbraco' (are you missing an assembly reference?)
    • The name 'Log' does not exist in the current context
    • The name 'LogTypes' does not exist in the current context
    • The type or namespace name 'ISqlHelper' does not exist in the namespace 'umbraco' (are you missing an assembly reference?)
    • The name 'Application' does not exist in the current context
    Assuming I need to add references to the relevant libraries? And my Umbraco setup (in VS2010) differs from yours?

     

  • Rob Watkins 343 posts 593 karma points
    Mar 21, 2012 @ 12:41
    Rob Watkins
    0

    Ah, okay, I'm not sure how Visual Studio deals with the App_Code folder, there seems to be some quirks with it depending on your project type, which might be causing your errors.

    The patch is for applying directly to a deployed Umbraco install on a web server, where the App_Code folder works as stated above. You don't need to add references or anything in this case, it will just work.

    Off the top of my head, for Visual Studio, I seem to remember that you change the Build Action of TagsAutoCompleteHandler_MySQL.ashx.cs from "Compile" to "Content"; then it should stop the error messages requiring references and just copy as-is to your deployment folder, at which point it should just work.

    I have never run anything within Visual Studio though I'm afraid, I always a use a remote server, so this is not based on testing!


  • Sean Dooley 268 posts 485 karma points
    Mar 21, 2012 @ 13:17
    Sean Dooley
    0

    Thanks Rob. Got past that hurdle now up against another hurdle

    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND CMSTAGS.ID NOT IN (SELECT TAGID FROM CMSTAGRELATION' at line 1"

    Will look into this one now.

  • Sean Dooley 268 posts 485 karma points
    Mar 21, 2012 @ 13:41
    Sean Dooley
    0

    Think have resolved query issue. Had LIMIT 20 in the middle of the query, so moved it to the end. Thanks for all your help Rob. Greatly appreciated!

  • Rob Watkins 343 posts 593 karma points
    Mar 21, 2012 @ 14:41
    Rob Watkins
    0

    Excellent, glad it's all working!

Please Sign in or register to post replies

Write your reply to:

Draft