From 97704900b9dd24f24b923f335453c75552326bd2 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 9 May 2024 08:41:28 +1000 Subject: [PATCH 1/2] Updated example dependency to be compatible with Drupal 11. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 494a1b1..e162e99 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": ">=8.2" }, "require-dev": { - "drupal/pathauto": "~1.0" + "drupal/role_delegation": "~1" }, "suggest": { "drupal/config_ignore": "Ignore certain configuration during import." From c98c3de5856f579b0e0ffa3d49580ad8fec15f83 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 8 May 2024 22:58:52 +1000 Subject: [PATCH 2/2] Fixed Drupal 11. --- .circleci/config.yml | 15 +++++++++++++-- .devtools/provision.sh | 3 ++- .github/workflows/scaffold-test.yml | 12 ++++++++++++ .github/workflows/test.yml | 15 ++++++++++++--- rector.php | 5 ++--- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ee13eca..5c7df3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,18 @@ job-test: &job-test - checkout - run: - name: Build the codebase + name: Upgrade sqlite3 + command: | + wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz + tar -xzf /tmp/sqlite.tar.gz -C /tmp + cd /tmp/sqlite-autoconf-3450300 + ./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local + make && sudo make install + sudo ldconfig + echo "export LD_LIBRARY_PATH=/usr/local/lib" >> $BASH_ENV + + - run: + name: Assemble the codebase command: .devtools/assemble.sh - run: @@ -111,7 +122,7 @@ jobs: - image: cimg/php:8.3-browsers environment: DRUPAL_VERSION: 11@alpha - DRUPAL_PROJECT_REPO: https://github.com/AlexSkrypnyk/drupal-project.git + DRUPAL_PROJECT_SHA: 11.x <<: *job-test deploy: diff --git a/.devtools/provision.sh b/.devtools/provision.sh index cef343c..162d416 100755 --- a/.devtools/provision.sh +++ b/.devtools/provision.sh @@ -54,7 +54,8 @@ fi db_file="/tmp/site_${extension}.sqlite" info "Installing Drupal into SQLite database ${db_file}." -drush si "${DRUPAL_PROFILE}" -y --db-url "sqlite://${db_file}" --account-name=admin install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL +drush site-install "${DRUPAL_PROFILE}" -y --db-url="sqlite://localhost/${db_file}" --account-name=admin install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL + pass "Drupal installed." drush status diff --git a/.github/workflows/scaffold-test.yml b/.github/workflows/scaffold-test.yml index 032a20b..851fc35 100644 --- a/.github/workflows/scaffold-test.yml +++ b/.github/workflows/scaffold-test.yml @@ -20,8 +20,20 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Upgrade sqlite3 + run: | + wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz + tar -xzf /tmp/sqlite.tar.gz -C /tmp + cd /tmp/sqlite-autoconf-3450300 + ./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local + make && sudo make install + sudo ldconfig + - name: Setup PHP uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + extensions: gd, sqlite, pdo_sqlite - name: Check coding standards uses: luizm/action-sh-checker@v0.8.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bbe11ca..e33d9da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,14 +37,13 @@ jobs: - name: test-php-8.3-next php-version: 8.3 drupal-version: 11@alpha - drupal-project-repo: https://github.com/AlexSkrypnyk/drupal-project.git + drupal-project-sha: 11.x name: ${{ matrix.name }} env: DRUPAL_VERSION: ${{ matrix.drupal-version }} DRUPAL_PROJECT_SHA: ${{ matrix.drupal-project-sha }} - DRUPAL_PROJECT_REPO: ${{ matrix.drupal-project-repo }} steps: - name: Checkout code @@ -56,12 +55,22 @@ jobs: path: /tmp/composer-cache key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + - name: Upgrade sqlite3 + run: | + wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz + tar -xzf /tmp/sqlite.tar.gz -C /tmp + cd /tmp/sqlite-autoconf-3450300 + ./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local + make && sudo make install + sudo ldconfig + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: gd, sqlite, pdo_sqlite - - name: Build the codebase + - name: Assemble the codebase run: .devtools/assemble.sh - name: Start built-in PHP server diff --git a/rector.php b/rector.php index 304ebc2..3c3afd9 100644 --- a/rector.php +++ b/rector.php @@ -12,7 +12,7 @@ declare(strict_types=1); -use DrupalFinder\DrupalFinder; +use DrupalFinder\DrupalFinderComposerRuntime; use DrupalRector\Set\Drupal10SetList; use DrupalRector\Set\Drupal8SetList; use DrupalRector\Set\Drupal9SetList; @@ -32,8 +32,7 @@ $rectorConfig->rule(DeclareStrictTypesRector::class); - $drupalFinder = new DrupalFinder(); - $drupalFinder->locateRoot(__DIR__); + $drupalFinder = new DrupalFinderComposerRuntime(); $drupalRoot = $drupalFinder->getDrupalRoot(); $rectorConfig->autoloadPaths([ $drupalRoot . '/core',