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

Webservice token creation form throws exceptions during validation

    XMLWordPrintable

Details

    • MOODLE_311_STABLE
    • MOODLE_311_STABLE
    • Hide
      1. Log in as admin
      2. Create a test user
      3. Navigate to Server > Web services > External services in site administration
      4. Under Custom services press Add
      5. Choose a name, tick Enabled and Authorised users only and save
      6. Navigate to Server > Web services > Manage tokens in site administration
      7. Press Create token
      8. Select test user in User field
      9. Select new service in Service field
      10. Press Save changes
      11. Confirm you see the error: "The user is not allowed for this service..."
      12. Confirm form shows without exceptions
      13. Confirm User field is still populated with test user
      Show
      Log in as admin Create a test user Navigate to Server > Web services > External services in site administration Under Custom services press Add Choose a name, tick Enabled and Authorised users only and save Navigate to Server > Web services > Manage tokens in site administration Press Create token Select test user in User field Select new service in Service field Press Save changes Confirm you see the error: "The user is not allowed for this service..." Confirm form shows without exceptions Confirm User field is still populated with test user

    Description

      When trying to create a token for a user who is not allowed to view the given service, the following exception is thrown, rather than the form showing the validation error and re-rendering:

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
       
      More information about this error
      Debug info: Object of class core_user\fields could not be converted to string
      Error code: codingerror
      Stack trace:
       
          line 427 of /lib/setuplib.php: coding_exception thrown
          line 1643 of /lib/dml/moodle_database.php: call to default_error_handler()
          line 1622 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
          line 59 of /webservice/classes/token_form.php: call to moodle_database->get_record()
          line 143 of /lib/form/autocomplete.php: call to core_webservice\token_form->core_webservice\{closure}()
          line ? of unknownfile: call to MoodleQuickForm_autocomplete->{closure}()
          line 149 of /lib/form/autocomplete.php: call to preg_replace_callback()
          line 192 of /lib/pear/HTML/QuickForm/Renderer/Tableless.php: call to MoodleQuickForm_autocomplete->toHtml()
          line 3292 of /lib/formslib.php: call to HTML_QuickForm_Renderer_Tableless->renderElement()
          line 430 of /lib/pear/HTML/QuickForm/element.php: call to MoodleQuickForm_Renderer->renderElement()
          line 1641 of /lib/pear/HTML/QuickForm.php: call to HTML_QuickForm_element->accept()
          line 1996 of /lib/formslib.php: call to HTML_QuickForm->accept()
          line 1684 of /lib/pear/HTML/QuickForm.php: call to MoodleQuickForm->accept()
          line 445 of /lib/pear/HTML/Common.php: call to HTML_QuickForm->toHtml()
          line 1027 of /lib/formslib.php: call to HTML_Common->display()
          line 78 of /admin/webservice/tokens.php: call to moodleform->display()
      

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Amaia Anabitarte Amaia Anabitarte
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Gladys Basiana Gladys Basiana
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 15 minutes
                  1h 15m

                  Clockify

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