Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9599

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

          Attachments

            Activity

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

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

            Show
            rezeau Joseph Rézeau added a comment - I do NOT see this problem at all in my recently updated Moodle 1.8. Joseph
            Hide
            singlow 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
            singlow 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
            singlow 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
            singlow 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
            melfo Alexander Pavlyutin added a comment - - edited

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

            Show
            melfo Alexander Pavlyutin added a comment - - edited Problem in edit_form.php. Line 38. Change $categoriesEl = $mform->... to $categoriesEl =& $mform->
            Hide
            mcampbell 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
            mcampbell 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
            singlow 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
            singlow 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
            singlow Jacob Williams added a comment -

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

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

            fixed in cvs, thanks for the report and patch!

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

            Moodle community rocks!

            Show
            soben Leang Chumsoben added a comment - Moodle community rocks!
            Hide
            agordon 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
            agordon 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
            mcampbell 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
            mcampbell 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
            agordon Andrea Gregory (Gordon) added a comment -

            Yes it is definately 1.8!

            Show
            agordon Andrea Gregory (Gordon) added a comment - Yes it is definately 1.8!
            Hide
            mcampbell 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
            mcampbell 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
            agordon 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
            agordon 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:
                  Fix Release Date:
                  8/Jul/07