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

"Only Serializable" classes are deprecated since PHP 8.1.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 4.1.2, 4.2
    • 4.1.1, 4.2
    • General
    • None
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE

      This was detected as part of MDL-73587 (PHPCompatibility complete run against codebase).

      There are a bunch of classes in codebase implementing the Serializable interface and don't implement the __serialize() and __unserialize() methods that were introduced in PHP 7.4 (as fix for __sleep() and __wakeup() and/or the Serializable interface itself.

      The complete message is:

      "Only Serializable" classes are deprecated since PHP 8.1. The magic __serialize() and __unserialize() methods need to be implemented for cross-version compatibility. Missing implementation of: __serialize() and __unserialize()

      See:

      And we have a good number of classes that, apparently, are implementing that Serializable interface and missing the new methods.

      Note this doesn't cause malfunction for now, only in PHP 9 that interface will stop working, but we should try to look for cases, report/upgrade them if they are 3rd part libs and fix any case found in our own codebase.

      In the next comment to the issue, I'll report all the cases found by PHPCompatibility.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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