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

Custom fields delete action causes an error message when handler is setup with "uses categories" = false.

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_37_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • Hide

      Setup

      1. Ensure your [dirroot]/local folder is writeable by the webserver (so we can use the plugin uploader tool), e.g.

        $ chmod 777 local
        

      Install plugin

      1. Login as admin
      2. Navigate to Plugins > Install plugins from site administration
      3. Upload local_cftest.zip to Install plugin from ZIP file file area
      4. Press Install plugin from the ZIP file
      5. Press Continue and complete the installation

      Manual test

      1. Navigate to [dirroot]/local/cftest/index.php?create=1 in your browser
      2. Press Add a new custom field and create a new Checkbox field
      3. Delete the custom field you just created
      4. Confirm you don't see an invalid response exception popup
      5. Confirm the table listing of custom fields reloads without the field you just deleted
      Show
      Setup Ensure your [dirroot] /local folder is writeable by the webserver (so we can use the plugin uploader tool), e.g. $ chmod 777 local Install plugin Login as admin Navigate to Plugins > Install plugins from site administration Upload local_cftest.zip to Install plugin from ZIP file file area Press Install plugin from the ZIP file Press Continue and complete the installation Manual test Navigate to [dirroot] /local/cftest/index.php?create=1 in your browser Press Add a new custom field and create a new Checkbox field Delete the custom field you just created Confirm you don't see an invalid response exception popup Confirm the table listing of custom fields reloads without the field you just deleted

    Description

      When a custom fields handler returns false for \core_customfield\handler::uses_categories

      trying to delete a custom field using the \core_customfield\output\management interface causes the following error.

      usescategories => Invalid response value detected (Invalid external api response: the value is "" of PHP type "boolean", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "boolean", the server was expecting "int" type
      Error code: invalidresponse
      * line 442 of /lib/externallib.php: invalid_response_exception thrown
      * line 250 of /lib/externallib.php: call to external_api::clean_returnvalue()
      * line 59 of /lib/ajax/service.php: call to external_api::call_external_function()
      

      It appears the \core_customfield_external::reload_template_returns it looking for a PARAM_INT but \core_customfield\handler::uses_categories returns PARAM_BOOL

      Attachments

        Activity

          People

            pholden Paul Holden
            booped Darren Brown
            David Carrillo David Carrillo
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 10 minutes
                2h 10m

                Clockify

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