Problem/Motivation
Subtheme creation fails with the following error:
[error] PHP Deprecated: Calling drupal is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the `dr` script instead. See https://www.drupal.org/node/3584928 in /var/www/html/web/core/scripts/drupal on line 16
PHP Warning: require(/var/www/html/web/core/scripts/../../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/web/core/scripts/dr on line 29
PHP Fatal error: Uncaught Error: Failed opening required '/var/www/html/web/core/scripts/../../vendor/autoload.php' (include_path='/var/www/html/vendor/pear/archive_tar:/var/www/html/vendor/pear/console_getopt:/var/www/html/vendor/pear/pear-core-minimal/src:/var/www/html/vendor/pear/pear_exception:.:/usr/share/php') in /var/www/html/web/core/scripts/dr:29
Stack trace:
#0 /var/www/html/vendor/autoload_runtime.php(27): {closure:/var/www/html/web/core/scripts/dr:23}()
#1 /var/www/html/web/autoload_runtime.php(22): require('...')
#2 /var/www/html/web/core/scripts/dr(18): require_once('...')
#3 /var/www/html/web/core/scripts/drupal(23): include('...')
#4 {main}
thrown in /var/www/html/web/core/scripts/dr on line 29I attached a screenshot
Steps to reproduce
after artisan installation with:
composer require 'drupal/artisan:^2.0'
the subtheme creation with this command fails:
drush --include="web/themes/contrib/artisan" artisan
Proposed resolution
The issue seems related to path building of the file: /vendor/autoload.php
As a workaround, I had to execute the command this way:
vendor/bin/dr generate-theme \
my_st_artisan \
--name="My Artisan Sub Theme" \
--starterkit=artisan_starterkit \
--path=themes/custom
prefix "ddev exec" if using ddev.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot From 2026-07-09 12-14-10.png | 73.24 KB | fzied |
Issue fork artisan-3609519
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
alejandro cabarcos commentedComment #9
omarlopesinoAfter reviewing the MR I think we need to refactor the entire command so we don't depend directly on drupal or drush binary locations. We can do this by just using Drupal and Drush APIs.
I've created a new MR here: https://git.drupalcode.org/project/artisan/-/merge_requests/61
I have checked it works on Drupal 11.4 and it should work on older Drupal 11 versions.
@alejandro @ivan please can you check it works minimally at Drupal 11.1, the minimal version we support? If so, it should work also for 11.2 and 11.3. Thanks!
Comment #10
alejandro cabarcos commentedThanks Omar!
Tested on 11.1.10 and 11.4.4, worked on both
Comment #13
alejandro cabarcos commented