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

mform disableif doesn't work on 'editor' element when wysiwig enabled

    Details

    • Testing Instructions:
      Hide

      This may only be testable by a dev as it relies on setting up a form that uses disabledif on an editor.

      To test, add this code inside a form:

      $mform->addElement('editor', 'fieldname', 'Editor');
      $mform->addElement('checkbox', 'somechekbox', 'Check to disable');
      $mform->disabledIf('fieldname', 'somechekbox', 'checked');
      

      Show
      This may only be testable by a dev as it relies on setting up a form that uses disabledif on an editor. To test, add this code inside a form: $mform->addElement('editor', 'fieldname', 'Editor'); $mform->addElement('checkbox', 'somechekbox', 'Check to disable'); $mform->disabledIf('fieldname', 'somechekbox', 'checked');
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_26_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE

      Description

      If you have a field that uses htmleditor and the user allows wysiwigs - the disableif check doesn't work - if they elect to use standard web forms in their profile - it works as expected.

      I can take a look at this - just might need some pointers on where/how to go about fixing it.

        Gliffy Diagrams

          Issue Links

            Activity

            danmarsden Dan Marsden created issue -
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited

            I've implemented this on https://github.com/crazyserver/moodle/tree/MDL-29701_MOODLE_25_STABLE testing needed!

            Cheers,

            Pau

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited I've implemented this on https://github.com/crazyserver/moodle/tree/MDL-29701_MOODLE_25_STABLE testing needed! Cheers, Pau
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Field Original Value New Value
            Pull Master Diff URL https://github.com/crazyserver/moodle/compare/MDL-29701_master
            Pull Master Branch MDL-29701_master
            Pull from Repository https://github.com/crazyserver/moodle/
            Hide
            danmarsden Dan Marsden added a comment -

            pushing up for peer review (I haven't had time to look at the patch myself) Thanks!

            Show
            danmarsden Dan Marsden added a comment - pushing up for peer review (I haven't had time to look at the patch myself) Thanks!
            danmarsden Dan Marsden made changes -
            Status Open [ 1 ] Waiting for peer review [ 10012 ]
            Testing Instructions This may only be testable by a dev as it relies on setting up a form that uses disabledif on an editor.
            cibot CiBoT made changes -
            Labels ci
            Hide
            cibot CiBoT added a comment -

            Fails against automated checks.

            Checked MDL-29701 using repository: https://github.com/crazyserver/moodle/

            More information about this report

            Show
            cibot CiBoT added a comment - Fails against automated checks. Checked MDL-29701 using repository: https://github.com/crazyserver/moodle/ master (branch: MDL-29701_master | CI Job ) Error: The MDL-29701 _master branch at https://github.com/crazyserver/moodle/ is very old (>60 days ago). Please rebase against current master. More information about this report
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited

            The patch is neither for MOODLE_26 nor master

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited The patch is neither for MOODLE_26 nor master
            Hide
            danmarsden Dan Marsden added a comment -

            Hi Pau, you've used the branch name "MDL-29701_master" and you have also placed the git branch and diff in the "master" git field in this tracker issue. If this was supposed to be for a different branch it would be good if you named your branch differently and placed the commit in the tracker field that reflects the branch that it is for - this will help CIBOT run the checks correctly.

            I took a look at your branch and it appears to be based on 2.5 - Moodle 2.5 is no longer supported for bug fixes and support for security fixes on the 2.5 branch ends in a couple of weeks. If this isn't a problem in 2.6 or higher we should close this issue off.

            thanks!

            Show
            danmarsden Dan Marsden added a comment - Hi Pau, you've used the branch name " MDL-29701 _master" and you have also placed the git branch and diff in the "master" git field in this tracker issue. If this was supposed to be for a different branch it would be good if you named your branch differently and placed the commit in the tracker field that reflects the branch that it is for - this will help CIBOT run the checks correctly. I took a look at your branch and it appears to be based on 2.5 - Moodle 2.5 is no longer supported for bug fixes and support for security fixes on the 2.5 branch ends in a couple of weeks. If this isn't a problem in 2.6 or higher we should close this issue off. thanks!
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Pull Master Branch MDL-29701_master
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            You are right Dan Marsden. Sorry for this mess....

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - You are right Dan Marsden . Sorry for this mess....
            Hide
            danmarsden Dan Marsden added a comment -

            no worries! - do you know if this is still an issue in newer versions?

            Show
            danmarsden Dan Marsden added a comment - no worries! - do you know if this is still an issue in newer versions?
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited

            Yes I think so, but the code is very different! Please change it to open again and I'll try to have a look.

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited Yes I think so, but the code is very different! Please change it to open again and I'll try to have a look.
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Affects Version/s 2.6.5 [ 13852 ]
            danmarsden Dan Marsden made changes -
            Original Estimate 0 minutes [ 0 ]
            Remaining Estimate 0 minutes [ 0 ]
            Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
            danmarsden Dan Marsden made changes -
            Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
            cibot CiBoT made changes -
            Labels ci
            marina Marina Glancy made changes -
            Labels patch triaged
            marina Marina Glancy made changes -
            Assignee moodle.com [ moodle.com ]
            marina Marina Glancy made changes -
            Status Development in progress [ 3 ] Open [ 1 ]
            Hide
            marina Marina Glancy added a comment -

            Thanks Pau for looking at it. Were you able to reproduce this bug on the latest 2.6 or 2.7?

            Show
            marina Marina Glancy added a comment - Thanks Pau for looking at it. Were you able to reproduce this bug on the latest 2.6 or 2.7?
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            While I find some time to work on this, I've rebased and rename my branch to reduce confusion:
            https://github.com/crazyserver/moodle/compare/moodle:MOODLE_25_STABLE...MDL-29701_MOODLE_25_STABLE

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - While I find some time to work on this, I've rebased and rename my branch to reduce confusion: https://github.com/crazyserver/moodle/compare/moodle:MOODLE_25_STABLE...MDL-29701_MOODLE_25_STABLE
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            It happens the same with Atto.. :_(

            Use this code in a form to test:

            $mform->addElement('editor', 'fieldname', 'Editor');
            $mform->addElement('checkbox', 'somechekbox', 'Check to disable');
            $mform->disabledIf('fieldname', 'somechekbox', 'checked');
            

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - It happens the same with Atto.. :_( Use this code in a form to test: $mform->addElement('editor', 'fieldname', 'Editor'); $mform->addElement('checkbox', 'somechekbox', 'Check to disable'); $mform->disabledIf('fieldname', 'somechekbox', 'checked');
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Testing Instructions This may only be testable by a dev as it relies on setting up a form that uses disabledif on an editor. This may only be testable by a dev as it relies on setting up a form that uses disabledif on an editor.

            To test, add this code inside a form:
            {code}
            $mform->addElement('editor', 'fieldname', 'Editor');
            $mform->addElement('checkbox', 'somechekbox', 'Check to disable');
            $mform->disabledIf('fieldname', 'somechekbox', 'checked');
            {code}
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Affects Version/s 2.9.1 [ 14853 ]
            Affects Version/s 2.8.7 [ 14852 ]
            pferre22 Pau Ferrer Ocaña (crazyserver) made changes -
            Component/s HTML Editor (Atto) [ 13230 ]
            marina Marina Glancy made changes -
            Link This issue has a non-specific relationship to MDL-29421 [ MDL-29421 ]
            Hide
            marina Marina Glancy added a comment -

            Thank you, linking to MDL-29421

            Show
            marina Marina Glancy added a comment - Thank you, linking to MDL-29421
            marina Marina Glancy made changes -
            Status Open [ 1 ] Open [ 1 ]
            Summary mform disabledif doesn't work on htmleditor when wysiwig enabled mform disableif doesn't work on 'editor' element when wysiwig enabled
            Sprint candidate Soon [ 10241 ]

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: