Autoload: drulma/src/Render/Callback.php does not comply with psr-4 autoloading standard

Created on 4 October 2024, 11 months ago

Problem/Motivation

When I run composer dump-autoload, Drulma has an issue:

Class Drupal\drulma\Render\Callback located in ./web/themes/contrib/drulma/src/Render/Callback.php does not comply with psr-4 autoloading standard (rule: Drulma\ => ./web/themes/contrib/drulma/src). Skipping.
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇯🇵Japan ptmkenny

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

Merge Requests

Comments & Activities

  • Issue created by @ptmkenny
  • I didn't get any issue after installing this theme and run command composer dump-autoload. my drupal version -10.1.8 PHP
    Version
    8.1.14

  • 🇯🇵Japan ptmkenny

    The issue occurs because this module's composer.json has the following:

      "psr-4": {
          "Drulma\\": "./src/"
      }
    

    As far as I can tell, this only affects the Render callback, which should be namespaced to Drulma instead of Drupal according to the composer.json. But this is not the way Drupal modules are usually written, so I am opening a PR to remove this instruction.

  • Merge request !13remove custom autoload in composer.json → (Merged) created by ptmkenny
  • Pipeline finished with Failed
    20 days ago
    Total: 113s
    #570090
  • 🇪🇸Spain rodrigoaguilera Barcelona

    Indeed it makes sense to remove it. I think it comes from a time were the src folder of themes was not autoloaded.

    Do you see why the pipeline is failing?

  • 🇯🇵Japan ptmkenny

    Pipeline had this error:

    *****************************************************************************************************************************
    This project contains a top-level directory named 'web' which is the same as the variable _WEB_ROOT. This variable defines the location for installing Drupal core and the clash may cause some jobs to fail or give misleading results.
     
    To resolve this, you can either rename the directory within your project or set a different custom value for the _WEB_ROOT variable. The name can be anything other than an existing directory in your project. 
    *****************************************************************************************************************************
    

    There was an empty file, web/.gitkeep, so I removed it. I don't actually know what this file was for, though. Is it safe to remove?

  • Pipeline finished with Failed
    19 days ago
    Total: 225s
    #570744
  • Pipeline finished with Failed
    19 days ago
    Total: 134s
    #570769
  • Pipeline finished with Failed
    19 days ago
    Total: 138s
    #570790
  • Pipeline finished with Failed
    19 days ago
    Total: 169s
    #570793
  • Pipeline finished with Failed
    19 days ago
    Total: 128s
    #570806
  • Pipeline finished with Failed
    19 days ago
    Total: 139s
    #570814
  • Pipeline finished with Failed
    19 days ago
    Total: 140s
    #570820
  • Pipeline finished with Failed
    19 days ago
    Total: 133s
    #570833
  • Pipeline finished with Success
    19 days ago
    Total: 131s
    #570843
  • 🇯🇵Japan ptmkenny

    Well, that was a way bigger pain than I expected :/

    But I fixed the tests. It seems that whitelist and blacklist have a block because they want us to use "allowList" now, but since these are parameters, we can't actually change that. So I ignored the lines individually.

  • 🇪🇸Spain rodrigoaguilera Barcelona

    Great cleanup :)

    Thanks for the contribution.
    I will roll a release to avoid the warning.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024