Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Tag links fail to find tagged discussions

I've got the "Tagging" plugin enabled (v. 1.1p1 on my v. 2.0.18.10 Vanilla site). The tags are created, can be seen in my admin dashboard, and get correctly listed in the sidebar of the site ("Popular Tags", with number - I'm using the default theme).

The trouble is: clicking on the tag link in the sidebar gives a "No items tagged with [tag]." message. But there are items tagged!

Can anyone help me troubleshoot this? I've search the community forum, but haven't been able to find this problem reported before.

Thanks!

Comments

  • Turn on the Debugging modus in the dashboard. It will show the SQL queries that are executed and then you have to search for the tagging Query.

    There was an error rendering this rich post.

  • (Thanks - I'm very new to this system!)

    In the class.tagging.plugin.php file in the Tagging plugin (from Garden v.2.0), there is a function DiscussionsController_Tagged_Create() which "Load(s) discussions for a specific tag." So I'm guessing that's the one that's the problem.

    In the debug output, I get this:

    TaggingPlugin->DiscussionsController_Tagged_Create(?OBJECT?, array('0' => 'schedule'))

    select DiscussionID
    from GDN_UserDiscussion UserDiscussion
    where UserID = '1'
     and Bookmarked = '1';
    

    But it's very difficult for me to see why the function fails to pull the related page data.

    Any further pointers? (And thanks for your patience!)

  • More searching turned up a post from December 2010 (!) which, it turns out, is precisely the problem I've got.

    If a post is an "Announcement", it cannot be found by its tag. If you "Unannounce", it is found no problem.

    So - that's the problem. Any ideas about how to fix it? (Again, with v. 1.1p1 Tagging plugin on my v. 2.0.18.10 Vanilla site.) I don't mind doing the odd hack to get this working until the next upgrade.

    Thanks!

  • Take a look at this page : http://vanillaforums.org/addon/tagging-plugin it's the 'tagging enhanced' plugin
    Scroll a bit down : PS: Bug where announcements are not shown when tag filter is on etc. etc. I don't know if you want to use the tagging enhanced. I thought basic tagging was built-in and tagging enhanced was the replacement of basic tagging, but you say you have version 1.1 and latest tagging enhanced version is lower.
    anyways ... there's some code there on that page, hope it helps.

    There was an error rendering this rich post.

  • maybe one of the versions on github that is newere than 1.1 will work with 2.0.18.x - but you will need to go back a few revisions (because the newest ones only work with 2.1 I believe). for that matter does the github version of tagging work with announcements in vanilla 2.1, I haven't tested.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @UnderDog - thanks for that: I should have been able to find that info. But I tried that fix (at line 191 in the /applications/vanilla/models/class.discussionmodel.php file current in my version of Vanilla), but it made no difference. I have looked for another value I could try in there, but don't know your code well enough. :/ Any other suggestions?

    @peregrine - good suggestion, and I tried a few possiblities from Github, but no improvement (and one, at least, "Bonked" - new one for me!).

  • OK - I think I discovered why. That "fix" is for the Enhanced Tagging plugin. I tried it, but it didn't like my site for some reason. So I'm back with the default version. I tried putting these lines from Enhanced into Default at line 107:

      //JP: Only filter by tag!
      $DiscussionModel->FilterToTagID = $TagID;
    

    so that the check would work, but it doesn't (obviously insufficient bit of code!). I'm thinking there has got to be a simple fix for this (even removing the "RemoveAnnouncements" check??) -- maybe?

    Thanks for the help with this!

  • peregrineperegrine MVP
    edited January 2014

    That "fix" is for the Enhanced Tagging plugin. I tried it,

    but it didn't like my site for some reason.

    an unknown reason for us as well ??????

    mixing and matching is not too easy to do.

    • disable tagging plugin
    • and completely remove the "tagging" folder (save the folder as a zip somewhere else. but remove the folder.

    • and follow the instructions and suggestions for installing the Enhanced Tagging plugin if you do indeed want to try it.

    • then actually report what it doesn't like about your system :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine - just to cross everything off :) I did as you recommended. Followed the instructions precisely, and tried to run Tagging Enhanced plugin. Two oddities: (1) I didn't get the "enable tagging" option in the Tagging Settings, and (2) on the front-end, I got a Big Blue BONK.

    It's a wee shame, since the "default" Tagging plugin works fairly well (I haven't tried removing tags, etc., to see how recount works and so on), but filtering out tagged Announcements seems weird (as it has to others before, from what I've found in older community posts).

  • peregrineperegrine MVP
    edited January 2014

    Two oddities: (1) I didn't get the "enable tagging" option in the Tagging Settings, and (2) on the front-end, I got a Big Blue BONK.

    Bonk, I decided to avoid "Bonk" questions - because you should know what to do when you get a bonk to tell us more.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine - I did enable the debugging module, but that didn't get past the "bonk". So this morning I re-installed "Tagging Enhanced", in order to follow instructions the link in @UnderDog's forum "signature" ("What to do if I get a Bonk Error?").

    And this morning ... it works. That's a little unnerving (there were no differences from my previous attempts at implementing this plugin)! So I'll stick with this working setup (it seems not to be "broke", anyway!) and I've learned something about Vanilla and trouble-shooting in the meanwhile.

    (Btw - I've only been using this system for a few days, so things that might appear obvious to a veteran user will be a little more opaque to a new user, even with attempts at diligent forum-searching, document-reading, and code-scouring. It's not always clear what one "should" know ;) so thanks for the patient offers of assistance - much appreciated.)

    Also (btw #2), since this is a long known problem (well over three years?) I'm a little suprised that the core "tagging" plugin still shows this unexpected behaviour, or that there isn't a simple fix simply for including "announcements" (which are, after all, simply Vanilla's version of a "sticky" post) in tag-filtered searches, even as an option. Perhaps an imminent release will resolve this?

    Thanks again!

  • erajaderajad New
    edited January 2014

    Sorry for yet another post - but it appears I spoke too soon.

    The Tagging Enhanced "BONKs", but only from root (i.e., http://example.com/) or "homepage (mine set to categories/all). Any other page (e.g., /discussions) renders just fine.

    So, this time I did follow @UnderDog's instructions. The start of the info looked like this (with line 32 in yellow highlighting):

    Trying to get property of non-object

    The error occurred on or near: /home/mysite/public_html/site/plugins/Tagging/class.tagmodule.php

    28: 
    29:       //JP: Initialise 
    30:       $this->_TagModuleTitle = ""; 
    31:       $this->_TagLinkURL = ""; //JP: Used to store TAG Link URL string (different for category vs discussions views) 
    32:       $this->_CategoryID = $Sender->Category->CategoryID; //JP: This variable will only contain value if categories controller is calling it
    33:       $this->_ControllerData = Array(); //JP: Used to store controller data
    34:       
    35:       parent::__construct($Sender);
    36:    }
    

    Additional information for support personnel:

    • Application: Vanilla
    • Application Version: 2.0.18.10
    • PHP Version: 5.3.28
    • Operating System: Linux
    • Server Software: Apache
    • User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
    • Request Uri: /
    • Controller: TagModule
    • Method: __construct

    So the "categories" page (route?) appears to be the problem. Is there help/fix for this? If not, I'll probably revert to the default tagging plugin and live with the non-finding of "announcements".

    I've put the full report in PNG (with minor obfuscations) on imgur just in case anyone is interested.

  • peregrineperegrine MVP
    edited January 2014

    So the "categories" page (route?) appears to be the problem. Is there help/fix for this?

    maybe this resolution will help

    http://vanillaforums.org/discussion/25364/homepage-bonk-error-appears-to-be-in-tagging-enhanced-module

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregine - I applied the fix (right through to the end of the thread) and it was partial.

    Almost everything is working, except in /categories view, when the "sidebar" produces URLs like this:

    http://example.com/categories/tagged/tagname&catid=
    

    That is, the category ID is not being found or applied. If I add the number manually, the link works.

    I ran DEBUG, and it pointed (again) at "line 32" in my previous post. This link is constructed in class.tagmodule.php at line 148 in the original version of the file, or at line 161 with your earlier fix applied (in any case, the second line after case "Categories": in the class="Box Tags" DIV):

    $TagLinkURLCatData = "&catid=".$this->_CategoryID;
    

    Somehow, I suppose this code (my "line 32", above)...

     $this->_CategoryID = $Sender->Category->CategoryID;
    

    ...is failing to pick up the category id.

    Are we getting closer? ;) (Thanks for persevering with this!)

  • I'm lost. if you are talking about enhanced tagging plugin now. post a new question under the enhanced tagging plugin and post all the changes you made in a zip file.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • for enhanced plugin.

    this will produce proper links. in /categories view,

    don't know if it will break anything else - don't thinks so though.

    let us know.

    in class.tagmodel.php

    try commenting out

        /*
                                case "Categories":
                                    $TagLinkURL = (T("categories/tagged/"));
                                    $TagLinkURLCatData = "&catid=".$this->_CategoryID;
    
                                    if (urlencode($Tag->Name) == $Tag->Name) {
                                      echo Anchor(htmlspecialchars($Tag->Name), $TagLinkURL.urlencode($Tag->Name).$TagLinkURLCatData);
                                   } else {
                                      echo Anchor(htmlspecialchars($Tag->Name), $TagLinkURL."?Tag=".urlencode($Tag->Name).$TagLinkURLCatData);
                                   }
                                break;
                               */
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine - Yes, that works. :) (The file is "class.tagmodule.php", btw.)

    It does lose the functionality of having tag filtering on a per-category basis, but it looks like (at the moment) the "ideal" functionality is that bit elusive.

    And yes, sorry, this did morph into "Tagging Enhanced" rather than core "tagging" plugin.

    As I see it, there would ideally be two outcomes from this thread (and your labours!):

    1. resolve the "Announcements" exclusion problem with the core "tagging" plugin; and
    2. solve the problem with "Tagging Enhanced" 3rd party plugin not being able to find the CategoryID.

    Both ought to be "do-able". But those will have to wait for another day, for me at least. I've got some pressing work, and am out of town for the next few days. I'll try to get back to this later next week some time. I'll post "clean" working code then, too.

    Meanwhile, there is at least no "bonk!" being thrown, and I'm grateful for @peregrine tracking with me through this thread.

    (I don't see a way of marking this thread "solved", but if an admin would like to, do feel free. Thanks!)

  • well - you could try vanilla 2.1b2 and the new version of tagging plugin :) to see if it fixes it. - if you can make a test clone of your forum. I don't think there is much work on backporting vanilla's add-ons from github to work on 2.0.18.10, i think they are concentrating on 2.1b2.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.