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

Hardcoded contextid in tinymce tiny_equation_filter

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79264-MOODLE_401_STABLE
    • MDL-79264-MOODLE_402_STABLE
    • MDL-79264-master
    • Hide
      1. Create a Course
      2. Ensure Tiny Editor is the default editor.
      3. Add a "Text and media area"
      4. In the Tiny Editor open the Equation editor (Tiny Menu  > Insert >  Equation editor)
      5. Enter the following in the modal textarea:

         x\ =\ \frac{\sqrt{144}}{2}\ \times\ (y\ +\ 12)
        

      6. Confirm the Equation preview is loaded successfully and MathJax replaces all the math symbols
      7. Open your developers tools in your browser to the console tab
      8. In the equation editor type a sentence (doesn't matter what)
        1. Confirm that the following message only shows occasionally and not once per character you type

          The core/event::notifyFilterContentUpdated() function has been moved to core_filters/events::notifyFilterContentUpdated. Please update your code to use the new module.
          

          For example if you type "Hello" quickly it should only show once. Before this it would have a number on the left-hand-side for each character, e.g. 5 [triangle] The core/event::notifyFilterContentUpdated() function has been moved to core_filters/events::notifyFilterContentUpdated. Please update your code to use the new module.

      Show
      Create a Course Ensure Tiny Editor is the default editor. Add a "Text and media area" In the Tiny Editor open the Equation editor (Tiny Menu  > Insert >  Equation editor) Enter the following in the modal textarea: x\ =\ \frac{\sqrt{144}}{2}\ \times\ (y\ +\ 12) Confirm the Equation preview is loaded successfully and MathJax replaces all the math symbols Open your developers tools in your browser to the console tab In the equation editor type a sentence (doesn't matter what) Confirm that the following message only shows occasionally and not once per character you type The core/event::notifyFilterContentUpdated() function has been moved to core_filters/events::notifyFilterContentUpdated. Please update your code to use the new module. For example if you type "Hello" quickly it should only show once. Before this it would have a number on the left-hand-side for each character, e.g. 5 [triangle] The core/event::notifyFilterContentUpdated() function has been moved to core_filters/events::notifyFilterContentUpdated. Please update your code to use the new module.

    Description

      This is probably a thing that not a lot of people will be able to reproduce but we managed to run into an issue with the tiny_equation_filter because it seems that the instance contextid, which normally is "1" is hardcoded, which again makes one of our moodle instances run into trouble because (don't ask me why) we have our moodle instance contextid at 2. Which means that in our DB in the context table the first entry is "2 | 10 | 0 | /2" instead it usually being "1 | 10 | 0 | /1". Although it is not an issue that many will have a problem with, in our opinion it should still be fixed. 

      One example of the hardcoded "1" can be found in: lib/editor/tiny/plugins/equation/amd/src/ui.js

      We created a patch for that and would appreciate it if it would be integrated into Moodle core asap. 

       

      Attachments

        1. image-2023-09-05-13-07-42-471.png
          image-2023-09-05-13-07-42-471.png
          452 kB
        2. MDL-79264.png
          MDL-79264.png
          549 kB
        3. Screenshot 2023-09-05 at 12.37.41.png
          Screenshot 2023-09-05 at 12.37.41.png
          24 kB
        4. tinymce.png
          tinymce.png
          452 kB

        Issue Links

          Activity

            People

              gregoreichelberger Gregor Eichelberger
              katpot Katarzyna Potocka
              Paul Holden Paul Holden
              Andrew Lyons Andrew Lyons
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              9 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Clockify

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