Moodle 2.2 - Possible minor bug in Tags block

Moodle 2.2 - Possible minor bug in Tags block

by Sandeep Kankatala -
Number of replies: 1

Hi

I added the course tags feature enabled, and then I added the Tags block in all course main pages.

On the footer section of this Tags block, there are three links:

1. my tags 2. all tags 3. course tags

Clicking on of the above links points to the current course in which the block exists. Ideally, my tags should point to http://yourmoodle.com/tag/coursetags_more.php?show=my&courseid=<id>; and similarly the all tags and course tags should work.

Source code:

In blocks_tags.php: I think coursetag_get_jscript_links($elementid, $coursetagslinks); needs to be changed

Can some one guide me on this?

// Navigation elements at the bottom of the block
                // show the alternative displays options if available
                /*$elementid = 'coursetagslinks_'.$this->instance->id;
                if ($mytags or $officialtags or $commtags or $coursetags) {
                    $this->content->footer .= '<div id="'.$elementid.'"></div>';
                }
                // This section sets the order of the links
                $coursetagslinks = array();
                if ($mytags) {
                    $coursetagslinks['my'] = array('title'=>get_string('mytags2', $tagslang),
                                                    'onclick'=>'f_mytags',
                                                    'text'=>get_string('mytags1', $tagslang));
                }
                // because alltags is always present, only show link if there is something else as well
                if ($alltags and ($mytags or $officialtags or $commtags or $coursetags)) {
                    $coursetagslinks['all'] = array('title'=>get_string('alltags2', $tagslang),
                                                    'onclick'=>'f_alltags',
                                                    'text'=>get_string('alltags1', $tagslang));
                }
                if ($officialtags) {
                    $coursetagslinks['off'] = array('title'=>get_string('officialtags2', $tagslang),
                                                    'onclick'=>'f_officialtags',
                                                    'text'=>get_string('officialtags1', $tagslang));
                }
                //if ($commtags) {
                //    $coursetagslinks['com'] = array('title'=>get_string('communitytags2', $tagslang),
                //                                    'onclick'=>'f_commtags',
                //                                    'text'=>get_string('communitytags1', $tagslang));
                //}
                if ($coursetags) {
                    $coursetagslinks['crs'] = array('title'=>get_string('coursetags2', $tagslang),
                                                    'onclick'=>'f_coursetags',
                                                    'text'=>get_string('coursetags1', $tagslang));
                }*/
                coursetag_get_jscript_links($elementid, $coursetagslinks);

 

Average of ratings: -
In reply to Sandeep Kankatala

Re: Moodle 2.2 - Possible minor bug in Tags block

by Jenny Gray -

Yes, you're right there are some problems with that area of the code.  We made a significant overhaul to the course tagging stuff in Moodle 2.4 (see MDL-15471).

When are you planning to upgrade to 2.4?  Maybe you can wait, or perhaps you'll need to back-port the changes to your current version of moodle.  That shouldn't be too difficult, because they're quite self-contained.  I've already put them into our Moodle 2.3 code at the OU.

One of the things we've done is to get rid of those links though.  If you really want them, then I can probably help you through fixing it.  If I remember rightly, its not so much the links as the javascript that ought to fire when they're clicked that is broken - take a look and see if your browser is reporting JS errors on page load.

 

Average of ratings: Useful (1)