Moodle

Error in ratings exported glossary entries

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Component/s: Glossary
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

When you view a secondary glossary with exported entries to the main glossary you get a menu for rating those entry (if ratings are allowed in the glossary) but when you try and rate those entries you get the error "This is not valid entry!"
That happens because those expoted entries don't belong to the secondary glossary any more but to the main glossary.
We shouldn't get the rating menu at all if the entry was exported to the main glossary (we should rate those entries only in the main glossary, were they belong, not in the secondary)

  1. new_patch_ratings.txt
    18/Mar/09 11:11 PM
    3 kB
    Yolanda Ordoñez Rufat
  2. patch_ratings.txt
    03/Mar/09 1:44 AM
    3 kB
    Yolanda Ordoñez Rufat

Activity

Hide
Yolanda Ordoñez Rufat added a comment -

patch with a solution for moodle 1.9.2

Show
Yolanda Ordoñez Rufat added a comment - patch with a solution for moodle 1.9.2
Hide
Yolanda Ordoñez Rufat added a comment -

We find a solution to this problem by not allowing the rating menu to shows when the entry is exported to the main glossary. We made so by adding a boolean parameter to the function glossary_print_entry_ratings() and by checking before calling that function if the entry to be show belongs to the glossary that's been shown.

I send a patch with our solution.

We tested this solution on a 1.9.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1; and a 1.7.2 moodle with a 4.1.22 mysql installed in a SUSE LINUX Enterprise Server 9

Show
Yolanda Ordoñez Rufat added a comment - We find a solution to this problem by not allowing the rating menu to shows when the entry is exported to the main glossary. We made so by adding a boolean parameter to the function glossary_print_entry_ratings() and by checking before calling that function if the entry to be show belongs to the glossary that's been shown. I send a patch with our solution. We tested this solution on a 1.9.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1; and a 1.7.2 moodle with a 4.1.22 mysql installed in a SUSE LINUX Enterprise Server 9
Hide
Yolanda Ordoñez Rufat added a comment -

We find out that there's still a problem when a glossary entry has an attachment.

The problem comes from the function glossary_print_attachments() in mod/glossary/lib.php where there's an object wrong referenced (in PHP 5 only, in PHP4 you get a copy of the object)
So instead of:
$newentry = $entry;
we should have
$newentry = clone($entry);

I've submitted a new patch including that change.

Show
Yolanda Ordoñez Rufat added a comment - We find out that there's still a problem when a glossary entry has an attachment. The problem comes from the function glossary_print_attachments() in mod/glossary/lib.php where there's an object wrong referenced (in PHP 5 only, in PHP4 you get a copy of the object) So instead of: $newentry = $entry; we should have $newentry = clone($entry); I've submitted a new patch including that change.
Hide
Salvador Meneses added a comment -

We have clients with this issue

Show
Salvador Meneses added a comment - We have clients with this issue

Dates

  • Created:
    Updated: