Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20849

Multiple extensions using the same autoloader prefix will overwrite previous

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Important
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.21
    • Fix Version/s: 4.7.23
    • Component/s: Core CiviCRM
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No
    • How it works currently:
      Two extensions using the same PSR-4 prefix will only allow classes from one to be autoloaded.
    • How it should work:
      Multiple extensions can use the same PSR-4 prefix.

      Description

      -CRM-17957- added support for PSR-4 autoloading in extensions. It uses the "setPsr4" method, which

       

      Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.

       

      This means that if two extensions use the same prefix only the last added will be used. For example both APIv4 and CiviCase use the "Civi\" prefix, and in my case the APIv4 classes were not autoloaded.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michael Michael Devery
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: