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

Inplace editable WS throws an exception if element is not editable anymore

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80694-403
    • Hide
      Setup
      1. Download the test patch: MDL-80694.diff
      2. Open a terminal and go to your moodle instance's root folder
      3. Apply the following sample patch

        git apply /path/to/MDL-80694.diff
        

      Test
      1. Create a course in topics format
      2. Turn editing mode on
      3. Edit a section name using inplace editable, change it to any value
      4. Edit a section name again and change it to 'locked'
      5. Make sure the inplace editable control is no longer available for this section and it is no longer editable, and there are no errors on the page
      After test

      Make sure to revert your changes. e.g. "git reset --hard"

      Show
      Setup Download the test patch: MDL-80694.diff Open a terminal and go to your moodle instance's root folder Apply the following sample patch git apply /path/to/MDL-80694.diff Test Create a course in topics format Turn editing mode on Edit a section name using inplace editable, change it to any value Edit a section name again and change it to 'locked' Make sure the inplace editable control is no longer available for this section and it is no longer editable, and there are no errors on the page After test Make sure to revert your changes. e.g. " git reset --hard "
    • WP Sprint 2024-I1.1 (Atlantic)

      I have an inplace editable element that is only one-way action.

      It is a select element with two values. Transition from A->B is allowed and from B->A is not
      (actual example - appointment booking, teacher can change the "Wait-listed" status into "Booked" but not vice versa)

      So basically it is an editable element but after you edit it, the plugin callback returns an instance of inplace_editable class but with 'editable' property set to false.

      This results in an exception:

      Error in response - Missing following required key in a single structure: editicon
      Error code: invalidresponse
      * line 446 of /lib/external/classes/external_api.php: invalid_response_exception thrown
      * line ? of unknownfile: call to core_external\external_api::clean_returnvalue()
      * line 259 of /lib/external/classes/external_api.php: call to call_user_func()
      * line 88 of /lib/ajax/service.php: call to core_external\external_api::call_external_function()
      

            marina Marina Glancy
            marina Marina Glancy
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 25 minutes
                3h 25m

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