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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0, 3.1
    • 3.0.1
    • Forms Library
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_30_STABLE
    • MDL-52451-master
    • 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

    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

            marina Marina Glancy
            marina Marina Glancy
            David Monllaó David Monllaó
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              21/Dec/15