Community Forums

ATutor Bug Reports

Error in glossary tool related term display


You must be signed-in to post.

AuthorSubject
 
Page: 1
skappes

Avatar for skappes
Subject: Error in glossary tool related term displayQuote this post in your reply
ATutor version - 2.1

In Version 2.1, now that the manage glossary tool (mods/_core/glossary/tools/index.php) uses a template
(themes/default/instructor/glossary/index.tmpl.php), the related term does not display. It worked fine in
Version 2.0.3. I looked over the code and don't think the related term value is being saved correctly. You'll
probably want to do it differently but thought I'd share how I fixed it just in case you find it useful.

Step 1: In mods/_core/glossary/tools/index.php, when a related term exists I added a related term key pair to the glossary row
array by changing the following code around line 69:

if ($row_related = mysql_fetch_array($result)) {
$related_word = $row_related['word'];
}

to:

if ($row_related = mysql_fetch_array($result)) {
$row[related_word] = $row_related['word']; // push the related term onto the glossary row
}

and since $related_word is no longer needed commented out the line:

$savant->assign('related_word', $related_word);


Step 2: In themes/default/instructor/glossary/index.tmpl.php around line 25, I changed:

<?php if(!empty($row['related_word_id'])):?>
<td valign="top"><?php //debug($this->related_word);
//echo AT_print($row[related_word_id], 'glossary.word'); ?></td>

(Note that the original code was already commented out...)

to:

<td valign="top">
<?php if(!empty($row['related_word_id'])):?>
<?php echo AT_print($row[related_word], 'glossary.word'); ?>
<?php endif; ?>
</td>
Posted: 2012-10-11 19:25:51
greg

Avatar for greg
Subject: Re: Error in glossary tool related term displayQuote this post in your reply
In our code it appears the template is not being used, and related terms are output directly from the glossary index.php file. Good catch though, we'll make a note and have the template added in a future version.

atutor.ca/atutor/mantis/view.php?id=5088

For now the related terms do output directly from the glossary/index.php file. Not sure why its not showing up on your system. Is your custom theme the default theme perhaps?
Posted: 2012-10-12 09:29:58
skappes

Avatar for skappes
Subject: Re: Error in glossary tool related term displayQuote this post in your reply
I don't think we're talking about the same code. The glossary/index file works fine and does not use a template. The code with the problem is the one used by the instructor (in Manage>Glossary) to update glossary terms - glossary/tools/index.php. It does call a template file now and did not in version 2.0.3.

My custom theme is based on the default theme from Version 2.0.3 so I pulled in the template from the default theme in Version 2.1.
Posted: 2012-10-12 17:44:40
greg

Avatar for greg
Subject: Re: Error in glossary tool related term displayQuote this post in your reply
I see now, and have noted the problem at:
atutor.ca/atutor/mantis/view.php?id=5091
Posted: 2012-10-15 12:45:14
greg

Avatar for greg
Subject: Re: Error in glossary tool related term displayQuote this post in your reply
Resolved with your recommended changes for 2.1.1, thx
atutor.ca/atutor/mantis/view.php?id=5091
Posted: 2013-02-11 16:17:19
 
Page: 1

You must be signed-in to post.

Related Articles