Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31167 PHP strict META
  3. MDL-32383

Error reported with PHP Strict for menu custom profile fields

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.2.2
    • Administration
    • MOODLE_22_STABLE
    • Easy

      After logging in I encountered the following error.

      Strict Standards: Declaration of profile_field_menu::edit_save_data_preprocess() should be compatible with that of profile_field_base::edit_save_data_preprocess() in D:\xampp\htdocs\moodle_testing\user\profile\field\menu\field.class.php on line 104

      The base class has edit_save_data_preprocess() with two arguments while the function in the menu field extended class only has one. This problem doesn't seem to affect the other profile types. The only other type that overloads this function is textarea and that uses two arguments.

      To make this function in the menu field class compliant, I added a second argument (reference) and that resolved the error message.

      /**
       * The data from the form returns the key. This should be converted to the
       * respective option string to be saved in database
       * Overwrites base class accessor method
       * @param   integer   the key returned from the select input in the form
       * @param   mixed     parameter required to satisfy overloading requirements
       */
      function edit_save_data_preprocess($key, &$ignore) {
          return isset($this->options[$key]) ? $this->options[$key] : NULL;
      }

            skodak Petr Skoda
            salvetore Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.