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

Glossary filter loop after Moodle 5 upgrade

    • MOODLE_500_STABLE
    • MDL-85307-500
    • MDL-85307-main
    • Hide

      Verify Memory Limit Fix

      1. Sign in as the admin
      2. Navigate to Site Administration > Plugins > Filters > Manager Filters
      3. Set 'Glossary auto-linking' 'Active?' field to 'On'
      4. Rearrange the order so this filter is at the top
      5. Verify the page does not crash with a 500 error  
      6. Create a course
      7. Add a Glossary activity
      8. General > Is this glossary global? = Checked
      9. Entries > Automatically link glossary entries = 'Yes' 
      10. Add an Entry for a common word appearing throughout the courses 
      11. I have lots of Lorem Ipsum texts throughout, so I added entries for these words (see attached xml) 
      12. Navigate to 'Auto-linking' and check the 'This entry should be automatically linked' check-box 
      13. Navigate back to the home page
      14. Verify the page does not crash with a 500 error
      15. Open the error log for the server
      16. For me this is /var/log/apache2/error.log 
      17. Verify there are no errors like
      18.  PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in [file path] on line 157, referer: [url] 
      19. Navigate around the site and add some more glossary entries, ensuring the entry is auto linked 
      20. Verify there are still no errors in the error log and no 500 errors 

      Verify No Regressions

      1. Install language packs for French and Spanish.
      2. Enable the Multi-language content filter applied to Content and headings and the Glossary auto-linking to Content
      3. Create a course.
      4. Turn editing on.
      5. Add a glossary activity named "MDL-85307 test <span class="multilang" lang="en">glossary</span><span class="multilang" lang="fr">glossaire</span><span class="multilang" lang="es">glossario</span>".
      6. Add an entry.
      7. Add the following concept:
        <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">inglés</span>
      8. Add the following definition on Source code mode:
        <span class="multilang" lang="en">Relating to England, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Angleterre, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con Inglaterra, su gente o el idioma hablado allí.</span>
      9. Check the 'This entry should be automatically linked' setting
      10. Click Save Changes.
      11. Add the following concept:
        <span class="multilang" lang="en">Spanish</span><span class="multilang" lang="fr">Espagnole</span><span class="multilang" lang="es">Castellano</span>
      12. Add the following definition on Source code mode:
        <span class="multilang" lang="en">Relating to Spain, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Espagne, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con España, su gente o el idioma hablado allí.</span>
      13. Check the 'This entry should be automatically linked' setting
      14. Click Save Changes.
      15. Add a new Text and media element on the course with the following content on Source code mode:
        <p>This is a text with the multilang syntax on the <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">Inglés</span> word that should be auto-linked.</p>
        <p>This are plain text words that should also be auto-linked: English, Anglais, Inglés.</p>
      16. Click Save Changes.
      17. Verify you only see the concept term and the definition of the term in the language corresponding to the current UI language.



       

      Show
      Verify Memory Limit Fix Sign in as the admin Navigate to Site Administration > Plugins > Filters > Manager Filters Set 'Glossary auto-linking' 'Active?' field to 'On' Rearrange the order so this filter is at the top Verify the page does not crash with a 500 error   Create a course Add a Glossary activity General > Is this glossary global? = Checked Entries > Automatically link glossary entries = 'Yes'  Add an Entry for a common word appearing throughout the courses  I have lots of Lorem Ipsum texts throughout, so I added entries for these words (see attached xml)  Navigate to 'Auto-linking' and check the 'This entry should be automatically linked' check-box  Navigate back to the home page Verify  the page does not crash with a 500 error Open the error log for the server For me this is /var/log/apache2/error.log  Verify  there are no errors like  PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in [file path] on line 157, referer: [url]   Navigate around the site and add some more glossary entries, ensuring the entry is auto linked  Verify there are still no errors in the error log and no 500 errors  Verify No Regressions Install language packs for  French  and  Spanish . Enable the  Multi-language content  filter applied to Content and headings and the  Glossary auto-linking  to Content Create a course. Turn editing on. Add a glossary activity named " MDL-85307  test <span class="multilang" lang="en">glossary</span><span class="multilang" lang="fr">glossaire</span><span class="multilang" lang="es">glossario</span>". Add an entry. Add the following concept: <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">inglés</span> Add the following definition on Source code mode: <span class="multilang" lang="en">Relating to England, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Angleterre, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con Inglaterra, su gente o el idioma hablado allí.</span> Check the 'This entry should be automatically linked' setting Click  Save Changes . Add the following concept: <span class="multilang" lang="en">Spanish</span><span class="multilang" lang="fr">Espagnole</span><span class="multilang" lang="es">Castellano</span> Add the following definition on Source code mode: <span class="multilang" lang="en">Relating to Spain, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Espagne, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con España, su gente o el idioma hablado allí.</span> Check the 'This entry should be automatically linked' setting Click  Save Changes . Add a new Text and media element on the course with the following content on Source code mode: <p>This is a text with the multilang syntax on the <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">Inglés</span> word that should be auto-linked.</p> <p>This are plain text words that should also be auto-linked: English, Anglais, Inglés.</p> Click  Save Changes . Verify you only see the concept term and the definition of the term in the language corresponding to the current UI language.  
    • Hide

      Code verified against automated checks.

      Checked MDL-85307 using repository: https://github.com/Jayce0808/moodle.git

      More information about this report

      Built on: Mon Jun 2 05:37:22 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85307 using repository: https://github.com/Jayce0808/moodle.git MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-85307-500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-85307-main | CI Job ] More information about this report Built on: Mon Jun 2 05:37:22 UTC 2025
    • 3
    • Team Alpha - Sprint 2 I2-2025

      After Moodle upgrade to latest Moodle 5 version, we have max memory execution error as Glossary filter loops data. If we go to Home page or to some of the courses it will give after some time max memory execution error as we investigated it loops data. If we turn off Glossary filter then everything works fine.

      1. Create a course
      2. Add Glossary activity
      3. Add Entry
      4. In settings set Auto-linking check-box This entry should be automatically linked

      And after this the course and other menus loops this entry and reaches max memory execution.

      If we remove new code everything works as it needs.

        1. image.png
          56 kB
          Eimantas Jakas
        2. Glossary.xml
          5 kB
          Jayce Birrell
        3. MDL-85307 - english.PNG
          10 kB
          Jayce Birrell
        4. MDL-85307 - french.PNG
          9 kB
          Jayce Birrell
        5. MDL-85307 - spanish.PNG
          9 kB
          Jayce Birrell
        6. MDL-85307 - spanish-1.PNG
          9 kB
          Jayce Birrell
        7. MDL-85307 test glossary.xml
          3 kB
          Jayce Birrell

            jayce.birrell@moodle.com Jayce Birrell
            eimantasjakas Eimantas Jakas
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 35 minutes
                1d 1h 35m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.