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

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

    Details

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

      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

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            samhemelryk 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
            samhemelryk 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
            samhemelryk 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
            samhemelryk 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
            nebgor Aparup Banerjee added a comment -

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

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

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

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

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

            Show
            jerome 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 Dongsheng Cai added a comment -
            Show
            dongsheng Dongsheng Cai added a comment - Pull request submitted: http://tracker.moodle.org/browse/PULL-12
            Hide
            skodak Petr Skoda added a comment -

            closing, thanks

            Show
            skodak Petr Skoda added a comment - closing, thanks
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Adding link to followup: MDL-25766

            Show
            stronk7 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:
                  Fix Release Date:
                  25/Dec/10