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

'Choose a link' for database URL field gives confusing message

    Details

    • Testing Instructions:
      Hide

      Create a database activity with a URL field.

      When you add a database entry there will probably be a "choose a link" button next to the text box. Click it to display the file picker.

      Make a note of all the repositories listed in the file picker.

      Go to the site admin manage repositories page and disable all of those repositories.

      Reload the database add entry page and there should now be no button next to the text field.

      Enabling one or more repositories like the you tube repository should cause the button to reappear.

      Similarly when adding a URL resource the "choose a link" button should appear or disappear depending on whether any URL supplying repositories are enabled.

      Show
      Create a database activity with a URL field. When you add a database entry there will probably be a "choose a link" button next to the text box. Click it to display the file picker. Make a note of all the repositories listed in the file picker. Go to the site admin manage repositories page and disable all of those repositories. Reload the database add entry page and there should now be no button next to the text field. Enabling one or more repositories like the you tube repository should cause the button to reappear. Similarly when adding a URL resource the "choose a link" button should appear or disappear depending on whether any URL supplying repositories are enabled.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-26244_url
    • Sprint:
      FRONTEND Sprint 6
    • Story Points (Obsolete):
      8
    • Sprint:
      FRONTEND Sprint 6

      Description

      Going to add/edit a record in the "Modules and plugins" database a user founds a lot of "Choose link" button. The problem is that these buttons are completely useless because the file picker page they call, displays: "Spiacente, nessuno dei repostory disponibili può restituire file esterni." [that in English should sound like: Sorry, none of the available repository may return external files.]
      Please take these buttons off.

        Gliffy Diagrams

          Activity

          Hide
          tsala Helen Foster added a comment -

          Daniele, thanks for your report. I've just changed it from a Moodle Community Sites issue to a Moodle issue, since it affects all Moodle sites.

          To reproduce:

          1. Ensure repositories to external sites such as Flickr, Merlot.org etc are disabled
          2. Attempt to add a new entry to a database activity containing a URL field
          3. Click the 'Choose a link' button next to the URL field

          The message "Sorry, none of your current repositories can return external files." is displayed in the file picker (see attached screenshot).

          This problem also occurs when attempting to add a new URL resource.

          Show
          tsala Helen Foster added a comment - Daniele, thanks for your report. I've just changed it from a Moodle Community Sites issue to a Moodle issue, since it affects all Moodle sites. To reproduce: 1. Ensure repositories to external sites such as Flickr, Merlot.org etc are disabled 2. Attempt to add a new entry to a database activity containing a URL field 3. Click the 'Choose a link' button next to the URL field The message "Sorry, none of your current repositories can return external files." is displayed in the file picker (see attached screenshot). This problem also occurs when attempting to add a new URL resource.
          Hide
          daniss Daniele Cordella added a comment - - edited

          Thanks Helen. You are always the faster HQ resource refining and triaging issues.
          Thanks for your revision to my bad English, too!

          Show
          daniss Daniele Cordella added a comment - - edited Thanks Helen. You are always the faster HQ resource refining and triaging issues. Thanks for your revision to my bad English, too!
          Hide
          wenxin Wenxin Lu added a comment -

          Totally agree, that button is 100% useless. Please remove it.

          Show
          wenxin Wenxin Lu added a comment - Totally agree, that button is 100% useless. Please remove it.
          Hide
          dongsheng Dongsheng Cai added a comment -

          This issue was assigned to me automatically, however 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
          dongsheng Dongsheng Cai added a comment - This issue was assigned to me automatically, however 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
          andyjdavis Andrew Davis added a comment -

          Putting this up for peer review. I've also removed some code that was setting variables that were never used.

          Show
          andyjdavis Andrew Davis added a comment - Putting this up for peer review. I've also removed some code that was setting variables that were never used.
          Hide
          abgreeve Adrian Greeve added a comment -

          Hello Andrew,

          Just a few things:

          1. Missing a component in the commit message.
          2. lib/form/url.php - white space on line 108
          3. I don't really like the way that the button is displayed. In mod_data and especially lib/form/url.php. Personally I think it would look better using html_writer, but I understand if you are just trying to keep with the current style of the function (though it looks so ugly).
          4. There are also some global variables that could be removed that aren't being used: $CFG, $COURSE, $USER

          Everything else looks fine.

          Thanks.

          Show
          abgreeve Adrian Greeve added a comment - Hello Andrew, Just a few things: Missing a component in the commit message. lib/form/url.php - white space on line 108 I don't really like the way that the button is displayed. In mod_data and especially lib/form/url.php. Personally I think it would look better using html_writer, but I understand if you are just trying to keep with the current style of the function (though it looks so ugly). There are also some global variables that could be removed that aren't being used: $CFG, $COURSE, $USER Everything else looks fine. Thanks.
          Hide
          andyjdavis Andrew Davis added a comment -

          I've fixed most of that stuff with the exception of the non-use of html_writer which I've left so it matches the rest of the file. Also adding a 2.5 version.

          Show
          andyjdavis Andrew Davis added a comment - I've fixed most of that stuff with the exception of the non-use of html_writer which I've left so it matches the rest of the file. Also adding a 2.5 version.
          Hide
          stronk7 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
          stronk7 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
          andyjdavis Andrew Davis added a comment -

          Rebased.

          Show
          andyjdavis Andrew Davis added a comment - Rebased.
          Hide
          poltawski Dan Poltawski added a comment -

          I think we need a 2.4 version of this?

          Show
          poltawski Dan Poltawski added a comment - I think we need a 2.4 version of this?
          Hide
          cibot CiBoT added a comment -

          Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.

          Show
          cibot CiBoT added a comment - Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.
          Hide
          andyjdavis Andrew Davis added a comment -

          Oops, added a 2.4 version.

          Show
          andyjdavis Andrew Davis added a comment - Oops, added a 2.4 version.
          Hide
          poltawski Dan Poltawski 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
          poltawski Dan Poltawski 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
          andyjdavis Andrew Davis added a comment -

          Rebased.

          Show
          andyjdavis Andrew Davis added a comment - Rebased.
          Hide
          poltawski Dan Poltawski added a comment -

          Integrated to master, 25 and 24 - thanks

          Show
          poltawski Dan Poltawski added a comment - Integrated to master, 25 and 24 - thanks
          Hide
          ankit_frenz Ankit Agarwal added a comment -

          Works as described, tested on 24-25-master.
          Thanks

          Show
          ankit_frenz Ankit Agarwal added a comment - Works as described, tested on 24-25-master. Thanks
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          "Aequam memento rebus in arduis servare mentem"

          Many thanks for your hard work, this is now part of "Moodle, the LMS". Closing!

          Ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - "Aequam memento rebus in arduis servare mentem" Many thanks for your hard work, this is now part of "Moodle, the LMS". Closing! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/13

                Agile