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

Form - Error when try create button array

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2.2
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide
      1. Copy test-file.php into your moodle directory.
      2. Navigate to test-file.php
      3. You should see a button with the value "Text to show"
      4. You should not see Fatal error: Trait 'templatable_form_element' not found in /home/adrian/moodles/stable_master_postgres/moodle/lib/form/button.php on line 44
      Show
      Copy test-file.php into your moodle directory. Navigate to test-file.php You should see a button with the value "Text to show" You should not see Fatal error: Trait 'templatable_form_element' not found in /home/adrian/moodles/stable_master_postgres/moodle/lib/form/button.php on line 44
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-57568-master

      Description

      $buttonarray = array();
      $buttonarray[] = &$mform->createElement('button', 'solicitacoes', 'Solicitações');
      $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);

      This code generate the error
      ( ! ) Fatal error: Trait 'templatable_form_element' not found in moodlepath\lib\form\button.php on line 44

      In form/button.php it import was missed
      require_once('templatable_form_element.php');

        Attachments

          Activity

            People

            Assignee:
            abgreeve Adrian Greeve
            Reporter:
            Helson Helson Araújo Castro
            Peer reviewer:
            Howard Miller
            Integrator:
            Andrew Nicols
            Tester:
            Ryan Wyllie
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Mar/17