Moodle
  1. Moodle
  2. MDL-23930

Database module templates JS error when attempting to insert field into editor.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      1671

      Description

      It would appear that it is no longer possible to double click a field within the available tags select box to have it inserted into the editor.

      By the looks of it when the templates text-area was converted to an editor this was forgotten about, if it is the case then it may be that a judgement call needs to be made on either getting rid of the available tags field and replacing it with a static list, or trying to integrate with the editors JS, which I imagine is possible however will pose a VERY big challenge should we ever actually get our multiple editor system off the ground.

      Cheers
      Sam

        Issue Links

          Activity

          Hide
          Sam Hemelryk added a comment -

          Hi Apu,

          I've assigned this issue to you as I seem to recall you were working in this area recently and thought you might be interested in this.

          I've also added Martin and Petr as watchers on this, Martin perhaps you've got some thoughts on this generally, and Petr if it's decided to integrate with the editors JavaScript you've probably have some ideas about how we could go about that in way that is going to be workable when we end up with multiple editors.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Apu, I've assigned this issue to you as I seem to recall you were working in this area recently and thought you might be interested in this. I've also added Martin and Petr as watchers on this, Martin perhaps you've got some thoughts on this generally, and Petr if it's decided to integrate with the editors JavaScript you've probably have some ideas about how we could go about that in way that is going to be workable when we end up with multiple editors. Cheers Sam
          Hide
          Sam Hemelryk added a comment -

          Sorry, should have also added more information about the actual problem....

          To reproduce:

          • Log in as an admin.
          • Enter a course.
          • Create a database activity.
          • Add a text field, call it anything.
          • Click the preset tab.
          • Wait for the editor to load then type some text into the editor.
          • Double click the name of the field you just added in the available tags box.

          Expected result:
          [[fieldname]] should be added into the editor at the point of the cursor.

          Actual result: JavaScript error
          Error: currTextarea is not defined
          Source File: http://sam.moodle.local/m20dev2/mod/data/data.js
          Line: 11

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Sorry, should have also added more information about the actual problem.... To reproduce: Log in as an admin. Enter a course. Create a database activity. Add a text field, call it anything. Click the preset tab. Wait for the editor to load then type some text into the editor. Double click the name of the field you just added in the available tags box. Expected result: [ [fieldname] ] should be added into the editor at the point of the cursor. Actual result: JavaScript error Error: currTextarea is not defined Source File: http://sam.moodle.local/m20dev2/mod/data/data.js Line: 11 Cheers Sam
          Hide
          Aparup Banerjee added a comment -

          i believe its the templates tab instead of presets.. looking into it now.

          Show
          Aparup Banerjee added a comment - i believe its the templates tab instead of presets.. looking into it now.
          Hide
          Sam Hemelryk added a comment -

          LOL yip sorry, templates tab, not the presets tab.... my last task was the presets tab

          Show
          Sam Hemelryk added a comment - LOL yip sorry, templates tab, not the presets tab.... my last task was the presets tab
          Hide
          Jérôme Mouneyrac added a comment - - edited

          I suggest to have the available tags as legend => get rid of javascript + select box.

          Show
          Jérôme Mouneyrac added a comment - - edited I suggest to have the available tags as legend => get rid of javascript + select box.
          Hide
          Dongsheng Cai added a comment -
          Show
          Dongsheng Cai added a comment - Pull request submitted: http://tracker.moodle.org/browse/PULL-12
          Hide
          Petr Škoda added a comment -

          closing, thanks

          Show
          Petr Škoda added a comment - closing, thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Adding link to followup: MDL-25766

          Show
          Eloy Lafuente (stronk7) added a comment - Adding link to followup: MDL-25766

            People

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

              Dates

              • Created:
                Updated:
                Resolved: