Moodle
  1. Moodle
  2. MDL-29807

Service add admin page: should be able to enter the unique shortname of a service

    Details

    • Testing Instructions:
      Hide

      Go to Home / ▶ Site administration / ▶ Plugins / ▶ Web services / ▶ External services

      Add a new service, enter a Name and Shortname, click on Add Service, add some functions (anyone it doesn't matter)...

      Edit the service again, check that the shortname can't be edited (is frozen)

      Add a new service, enter an existing Shortname (the previous one), an error should be displayed and the service should not be saved

      Show
      Go to Home / ▶ Site administration / ▶ Plugins / ▶ Web services / ▶ External services Add a new service, enter a Name and Shortname, click on Add Service, add some functions (anyone it doesn't matter)... Edit the service again, check that the shortname can't be edited (is frozen) Add a new service, enter an existing Shortname (the previous one), an error should be displayed and the service should not be saved
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      18821

      Description

      Each service has a unique shortname. Admin should be able to set it in the service add page (not edit page, however the edit page should display it).

        Issue Links

          Activity

          Hide
          Jérôme Mouneyrac added a comment -

          Increasing the priority as more people in the forum request it.

          Show
          Jérôme Mouneyrac added a comment - Increasing the priority as more people in the forum request it.
          Hide
          Jérôme Mouneyrac added a comment -

          Need to change doc texts indicating that you can not change the service shortname from the administration. It should be in the dev docs. It may also be in web service FAQ, even in the code. Look for it.

          Show
          Jérôme Mouneyrac added a comment - Need to change doc texts indicating that you can not change the service shortname from the administration. It should be in the dev docs. It may also be in web service FAQ, even in the code. Look for it.
          Hide
          Jérôme Mouneyrac added a comment - - edited

          I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
          For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          Show
          Jérôme Mouneyrac added a comment - - edited I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
          Hide
          CiBoT added a comment -

          Results for MDL-29807

          • Remote repository: git://github.com/jleyva/moodle.git
          Show
          CiBoT added a comment - Results for MDL-29807 Remote repository: git://github.com/jleyva/moodle.git Remote branch MDL-29807 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1927 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1927/artifact/work/smurf.html
          Hide
          CiBoT added a comment -

          Results for MDL-29807

          • Remote repository: git://github.com/jleyva/moodle.git
          Show
          CiBoT added a comment - Results for MDL-29807 Remote repository: git://github.com/jleyva/moodle.git Remote branch MDL-29807 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1931 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1931/artifact/work/smurf.html
          Hide
          Martin Dougiamas added a comment -

          Code looks simple enough and correct to me.

          Show
          Martin Dougiamas added a comment - Code looks simple enough and correct to me.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          CiBoT added a comment -

          Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

          Show
          CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
          Hide
          Marina Glancy added a comment -

          Hi Juan,
          at the moment it is allowed to add one service without shortname but not allowed to add the second service without shortname, so it is a loss of functionality.

          Holding this if you can provide a quick fix

          Show
          Marina Glancy added a comment - Hi Juan, at the moment it is allowed to add one service without shortname but not allowed to add the second service without shortname, so it is a loss of functionality. Holding this if you can provide a quick fix
          Hide
          Marina Glancy added a comment -

          Also while testing I got debugging messages about missing fields in snapshots. Are you testing your code with developer debugging?

          I can create a separate issue for it but maybe you can just do it as part of your fix? You only need to remove $event->add_record_snapshot from admin/webservice/service.php for both adding and editing a web service

          Fields list in snapshot record does not match fields list in 'external_services'. Record is missing fields: component, timemodified
          
              line 670 of /lib/classes/event/base.php: call to debugging()
              line 87 of /admin/webservice/service.php: call to core\event\base->add_record_snapshot()
          
          Fields list in snapshot record does not match fields list in 'external_services'. Record is missing fields: component, timecreated, shortname
          
              line 670 of /lib/classes/event/base.php: call to debugging()
              line 102 of /admin/webservice/service.php: call to core\event\base->add_record_snapshot()
          
          Show
          Marina Glancy added a comment - Also while testing I got debugging messages about missing fields in snapshots. Are you testing your code with developer debugging? I can create a separate issue for it but maybe you can just do it as part of your fix? You only need to remove $event->add_record_snapshot from admin/webservice/service.php for both adding and editing a web service Fields list in snapshot record does not match fields list in 'external_services'. Record is missing fields: component, timemodified line 670 of /lib/classes/event/base.php: call to debugging() line 87 of /admin/webservice/service.php: call to core\event\base->add_record_snapshot() Fields list in snapshot record does not match fields list in 'external_services'. Record is missing fields: component, timecreated, shortname line 670 of /lib/classes/event/base.php: call to debugging() line 102 of /admin/webservice/service.php: call to core\event\base->add_record_snapshot()
          Hide
          Marina Glancy added a comment -

          oh and yet another one: editing the web service that existed before this change (i.e. has 'null' in DB as shortname) gave error:

          Notice: Undefined index: shortname in /home/marina/repositories/master/moodle/admin/webservice/forms.php on line 161
          
          Show
          Marina Glancy added a comment - oh and yet another one: editing the web service that existed before this change (i.e. has 'null' in DB as shortname) gave error: Notice: Undefined index: shortname in /home/marina/repositories/master/moodle/admin/webservice/forms.php on line 161
          Hide
          Juan Leyva added a comment -

          Hi Marina,

          wow, yes developer debuggin was disabled (sorry, I didn't know what happened)

          I've fixed all the problems you found, thanks

          Regards

          Show
          Juan Leyva added a comment - Hi Marina, wow, yes developer debuggin was disabled (sorry, I didn't know what happened) I've fixed all the problems you found, thanks Regards
          Hide
          Marina Glancy added a comment -

          Thanks Juan, this has been integrated in master

          Show
          Marina Glancy added a comment - Thanks Juan, this has been integrated in master
          Hide
          Frédéric Massart added a comment -

          Passing, thanks.

          Show
          Frédéric Massart added a comment - Passing, thanks.
          Hide
          Marina Glancy added a comment -

          Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

          Show
          Marina Glancy added a comment - Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

            People

            • Votes:
              8 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: