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

Glossary filter causes "Undefined property: cm_info::$uservisible"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.8
    • Fix Version/s: None
    • Component/s: Glossary, Libraries
    • Labels:
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      An auto-linked entry in a glossary that's not available to some course participants causes this to show for them with the glossary auto-linking filter activated:

      Undefined property: cm_info::$uservisible

      When we activated the glossary auto-linking filter for our site some of our users just saw a white page with this error after logging in. They couldn't use Moodle anymore. Others saw the error in other places. It also caused scheduled tasks to fail.

      See the attached stack traces (made with Moodle 3.9.8). The relevant part is this:

      • {main}
      • ...
      • format_string
      • ...
      • filter_glossary->filter()
      • ...
      • mod_glossary\local\concept_cache::get_course_concepts()
      • cm_info->__get() # reading property cm_info->uservisible
      • cm_info->get_user_visible()
      • cm_info->obtain_dynamic_data()
      • ...
      • availability_group\condition->get_description
      • format_string
      • ...
      • filter_glossary->filter()
      • ...
      • mod_glossary\local\concept_cache::get_course_concepts()
      • # reading property cm_info->uservisible, which is now just a private member, from outside its class
      • # error

      To reproduce:

      1. Login as admin
        1. Set Debug level to DEVELOPER and check "Display debug messages"
        2. Activate glossary auto-linking filter
          • Apply to content and headings
        3. Create course
        4. Enroll student
        5. Create group G
        6. Create glossary
          • Restrict access for glossary to group G
        7. Create glossary entry
          • Check "This entry should be automatically linked"
      2. Login as student
        1. Go to course

      You get the error shown in the attached screenshot.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            tschroeder Tim Schroeder
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: