LoggerProxyTrait is not autoload optimized

Created on 8 February 2024, 10 months ago
Updated 13 February 2024, 10 months ago

Problem/Motivation

Due to incorrect file names and classes we have next issues in logs:

Class Drupal\opentelemetry\OpentelemetryLoggerProxyTrait located in ./docroot/modules/contrib/opentelemetry/src/OpentelemetryLoggerProxyTrait.D10.inc does not comply with psr-4 autoloading standard. Skipping.
Class Drupal\opentelemetry\OpentelemetryLoggerProxyTrait located in ./docroot/modules/contrib/opentelemetry/src/OpentelemetryLoggerProxyTrait.D9.inc does not comply with psr-4 autoloading standard. Skipping.

Steps to reproduce

1. Install `fenetikm/autoload-drupal`
2. Add `"fenetikm/autoload-drupal": true` to "config => allow-plugins" section in composer.json
3. Add this settings to "config" section of composer.json

"optimize-autoloader": true,
"apcu-autoloader": true

Add this to the "extra" section of composer.json

        "autoload-drupal": {
            "modules": [
                "docroot/modules/contrib/",
                "docroot/modules/custom/",
                "docroot/core/modules/"
            ]
        }

4. Install opentelemetry module as usual with composer require
5. Observe issues in log

Proposed resolution

1. Move function from OpentelemetryLoggerProxyTrait.D10.inc directly to OpentelemetryLoggerProxy.php
2. Drop OpentelemetryLoggerProxyTrait.D9.inc trait as Drupal 9 is EOL ( https://www.drupal.org/docs/understanding-drupal/drupal-9-release-date-a... )

Remaining tasks

1. Create a patch
2. Adjust tests

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

🇵🇱Poland dmitry.korhov Poland, Warsaw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024