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

\single_select::export_for_template() doesn't set attributes

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.5, 3.6.3, 3.7
    • 3.5.6, 3.6.4
    • Forms Library
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-65081-master
    • Hide
      1. Copy test_selects.php to your Moodle instance's root folder.
      2. Open it on your browser: [YOUR_MOODLE_URL]/test_selects.php
      Single select
      1. Check the Single select element visually.
      2. Confirm that its label is shown in bold font.
      3. Confirm that it's not disabled.
      4. Inspect the label of the select element.
      5. Confirm that its "for" attribute is not set to "fake_id"
      6. Confirm that it has a "class" attribute which is set to 'p-1'
      7. Inspect the select element.
      8. Confirm that you see the attributes with the following values:
        data-action some action
        data-something Some cool data
        class custom-select singleselect
        title This is the real title
      URL select
      1. Check the URL select element visually.
      2. Confirm that its label is shown in bold font.
      3. Confirm that it's not disabled.
      4. Inspect the label of the select element.
      5. Confirm that its "for" attribute is not set to "fake_id"
      6. Confirm that it has a "class" attribute which is set to 'p-1'
      7. Inspect the select element.
      8. Confirm that you see the attributes with the following values:
        data-action some action
        data-something Some cool data
        class custom-select urlselect
        title This is the real title
      Show
      Copy test_selects.php to your Moodle instance's root folder. Open it on your browser: [YOUR_MOODLE_URL] /test_selects.php Single select Check the Single select element visually. Confirm that its label is shown in bold font. Confirm that it's not disabled. Inspect the label of the select element. Confirm that its " for " attribute is not set to " fake_id " Confirm that it has a " class " attribute which is set to ' p-1 ' Inspect the select element. Confirm that you see the attributes with the following values: data-action some action data-something Some cool data class custom-select singleselect title This is the real title URL select Check the URL select element visually. Confirm that its label is shown in bold font. Confirm that it's not disabled. Inspect the label of the select element. Confirm that its " for " attribute is not set to " fake_id " Confirm that it has a " class " attribute which is set to ' p-1 ' Inspect the select element. Confirm that you see the attributes with the following values: data-action some action data-something Some cool data class custom-select urlselect title This is the real title

    Description

      The \single_select::export_for_template() doesn't set the attributes. For example:

      $attributes = [
          'data-action' => 'some action'
      ];
      echo $OUTPUT->single_select('#', 'action', $options, null, ['' => 'choosedots'], 'formid', $attributes);
      

      The HTML for the select element doesn't include the 'data-action' attribute.

      Attachments

        Issue Links

          Activity

            People

              jpataleta Jun Pataleta
              jpataleta Jun Pataleta
              Michael Hawkins Michael Hawkins
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Janelle Barcega Janelle Barcega
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/May/19

                Time Tracking

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