Moodle
  1. Moodle
  2. MDL-9599

Glossary terms revert back to 'Not categorized' when using categories.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.2
    • Component/s: Glossary
    • Labels:
      None
    • Environment:
      Debian-Linux, MySQL 5.0.27, PHP 4.4.4.8.1
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Using Moodle 1.8 + (2007021503)

      Can create categories in glossary without any issue, and when assigning a term/concept to a category, everything appears to work just fine. However, when you view the term again, it still shows that it is not categorized. When you click on the 'Browse by Category' tab, no entries are shown.

        Gliffy Diagrams

          Activity

          Hide
          Matt Campbell added a comment -
          Show
          Matt Campbell added a comment - Small discussion at http://moodle.org/mod/forum/discuss.php?d=70156#p314685
          Hide
          Joseph Rézeau added a comment -

          I do NOT see this problem at all in my recently updated Moodle 1.8.
          Joseph

          Show
          Joseph Rézeau added a comment - I do NOT see this problem at all in my recently updated Moodle 1.8. Joseph
          Hide
          Jacob Williams added a comment -

          Using PHP4 I had same problem and I looked at edit.php. Line 130 has a foreach that was never being entered because the $fromform->categories was a single scalar value. Commented that out and did an assignment that only works for one category:

          if (empty($fromform->notcategorised) && isset($fromform->categories)) {
          $newcategory->entryid = $e;
          //foreach ($fromform->categories as $category) {
          // if ( $category > 0 )

          { // $newcategory->categoryid = $category; // insert_record("glossary_entries_categories", $newcategory, false); // }

          else

          { // break; // }

          //}
          if ( $fromform->categories > 0 )

          { $newcategory->categoryid = $fromform->categories; insert_record("glossary_entries_categories", $newcategory, false); }

          }

          So either PHP4's foreach behaves differently or PHP4 is involved in $fromform->categories not being an array.

          Show
          Jacob Williams added a comment - Using PHP4 I had same problem and I looked at edit.php. Line 130 has a foreach that was never being entered because the $fromform->categories was a single scalar value. Commented that out and did an assignment that only works for one category: if (empty($fromform->notcategorised) && isset($fromform->categories)) { $newcategory->entryid = $e; //foreach ($fromform->categories as $category) { // if ( $category > 0 ) { // $newcategory->categoryid = $category; // insert_record("glossary_entries_categories", $newcategory, false); // } else { // break; // } //} if ( $fromform->categories > 0 ) { $newcategory->categoryid = $fromform->categories; insert_record("glossary_entries_categories", $newcategory, false); } } So either PHP4's foreach behaves differently or PHP4 is involved in $fromform->categories not being an array.
          Hide
          Jacob Williams added a comment -

          After testing on PHP5 I noticed that the category list allows multiple selections, while in my php4 environment, it is a single-select. This seems directly related to the fact that the variable coming back is not an array.

          Show
          Jacob Williams added a comment - After testing on PHP5 I noticed that the category list allows multiple selections, while in my php4 environment, it is a single-select. This seems directly related to the fact that the variable coming back is not an array.
          Hide
          Alexander Pavlyutin added a comment - - edited

          Problem in edit_form.php. Line 38.
          Change $categoriesEl = $mform->... to $categoriesEl =& $mform->

          Show
          Alexander Pavlyutin added a comment - - edited Problem in edit_form.php. Line 38. Change $categoriesEl = $mform->... to $categoriesEl =& $mform->
          Hide
          Matt Campbell added a comment -

          Confirmed that adding the & to line 38 as recommended by Alexander Pavlyutin fixes this issue when using PHP4. Could someone check this on PHP5?

          Show
          Matt Campbell added a comment - Confirmed that adding the & to line 38 as recommended by Alexander Pavlyutin fixes this issue when using PHP4. Could someone check this on PHP5?
          Hide
          Jacob Williams added a comment -

          I have tested on Apache2/PHP5 and Apache1.x/PHP4. Both work fine now. They both display a multiselect input and record the selected category for the entry.

          Show
          Jacob Williams added a comment - I have tested on Apache2/PHP5 and Apache1.x/PHP4. Both work fine now. They both display a multiselect input and record the selected category for the entry.
          Hide
          Jacob Williams added a comment -

          BTW - Comment just posted should have been explicit: I was using Alexander's fix.

          Show
          Jacob Williams added a comment - BTW - Comment just posted should have been explicit: I was using Alexander's fix.
          Hide
          Petr Skoda added a comment -

          fixed in cvs, thanks for the report and patch!

          Show
          Petr Skoda added a comment - fixed in cvs, thanks for the report and patch!
          Hide
          Leang Chumsoben added a comment -

          Moodle community rocks!

          Show
          Leang Chumsoben added a comment - Moodle community rocks!
          Hide
          Andrea Gregory (Gordon) added a comment -

          Where is the edit_form.php? There isn't such a file in the glossary - i've only got edit.php and editcategories.php!!

          Thanks in advance!

          Andrea

          Show
          Andrea Gregory (Gordon) added a comment - Where is the edit_form.php? There isn't such a file in the glossary - i've only got edit.php and editcategories.php!! Thanks in advance! Andrea
          Hide
          Matt Campbell added a comment -

          Could you confirm that you are using Moodle 1.8.x? edit_form.php was introduced in 1.8 and would not exist in an earlier version of Moodle.

          Thanks,
          Matt

          Show
          Matt Campbell added a comment - Could you confirm that you are using Moodle 1.8.x? edit_form.php was introduced in 1.8 and would not exist in an earlier version of Moodle. Thanks, Matt
          Hide
          Andrea Gregory (Gordon) added a comment -

          Yes it is definately 1.8!

          Show
          Andrea Gregory (Gordon) added a comment - Yes it is definately 1.8!
          Hide
          Matt Campbell added a comment -

          I would suspect that something didn't completely install, then. Is this installation working as you would expect, or are you having problems? How did you download this? What version do you have in /mod/glossary/version.php?

          Thanks,
          Matt

          Show
          Matt Campbell added a comment - I would suspect that something didn't completely install, then. Is this installation working as you would expect, or are you having problems? How did you download this? What version do you have in /mod/glossary/version.php? Thanks, Matt
          Hide
          Andrea Gregory (Gordon) added a comment -

          No everything on the site works completely fine and has done for a few months now. Just finding this problem now. Code from version.php below:

          <?php // $Id: version.php,v 1.56 2007/02/02 13:02:28 moodler Exp $

          /////////////////////////////////////////////////////////////////////////////////
          /// Code fragment to define the version of glossary
          /// This fragment is called by moodle_needs_upgrading() and /admin/index.php
          /////////////////////////////////////////////////////////////////////////////////

          $module->version = 2007020200;
          $module->requires = 2007020200; // Requires this Moodle version
          $module->cron = 0; // Period for cron to check this module (secs)

          ?>

          Thanks again
          Andrea

          Show
          Andrea Gregory (Gordon) added a comment - No everything on the site works completely fine and has done for a few months now. Just finding this problem now. Code from version.php below: <?php // $Id: version.php,v 1.56 2007/02/02 13:02:28 moodler Exp $ ///////////////////////////////////////////////////////////////////////////////// /// Code fragment to define the version of glossary /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// $module->version = 2007020200; $module->requires = 2007020200; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) ?> Thanks again Andrea

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: