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

Removal of functions call_user_method and call_user_method_array in PHP7

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.1
    • Fix Version/s: 3.0.1
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide

      Create a custom form and add there:

              $options = array('all' => get_string('any'), 'm' => 'Maths');
              $mform->addElement('select', 'subject', get_string('subject', 'block_community'),
                  $options, array('id' => 'communitysubject'));
              unset($options);
              $mform->addHelpButton('subject', 'subject', 'block_community');
              $this->init_javascript_enhancement('subject', 'smartselect',
                  array('selectablecategories' => true, 'mode' => 'compact'),
                  array('noresults', array('allday', 'calendar')));
      

      Render the form, browse source code and make sure the strings 'noresult','moodle' and 'allday','calendar' are loaded.

      Before this patch this code will show notice on PHP5 and fatal error on PHP7

      Show
      Create a custom form and add there: $options = array('all' => get_string('any'), 'm' => 'Maths'); $mform->addElement('select', 'subject', get_string('subject', 'block_community'), $options, array('id' => 'communitysubject')); unset($options); $mform->addHelpButton('subject', 'subject', 'block_community'); $this->init_javascript_enhancement('subject', 'smartselect', array('selectablecategories' => true, 'mode' => 'compact'), array('noresults', array('allday', 'calendar'))); Render the form, browse source code and make sure the strings 'noresult','moodle' and 'allday','calendar' are loaded. Before this patch this code will show notice on PHP5 and fatal error on PHP7
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull Master Branch:
      MDL-52451-master

      Description

      looks like we are affected:

      $ git grep call_user_method
      lib/formslib.php:                        call_user_method_array('string_for_js', $PAGE->requires, $string);
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                21/Dec/15