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

Renaming classes from the old to new autoloading convention does not result in debugging messages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.10
    • Fix Version/s: None
    • Component/s: Other
    • Labels:
      None
    • Affected Branches:
      MOODLE_310_STABLE

      Description

      There is a case where the class renaming in Moodle does not work well.

      If you have a class with a name like: mod_myplugin_myclass and want to rename it to mod_myplugin/myclass and have a db/renamedclasses.php like:

      $renamedclasses = [
          'mod_myplugin_myclass' => 'mod_myplugin/myclass',
      ];
      

      Uses of mod_myplugin_myclass will result in a class not found exception, rather than a debugging message.

      This seems to be happening because Moodle always generates both mod_myplugin_myclass and mod_myplugin/myclass in the valid mapping for each file found in the classes directory of plugins.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nmagill Neill Magill
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: