1

I try to update a Drupalmachine on 9.4.5 site via composer 2.4.1. ~/bin/composer.phar update drupal/core "drupal/core-*" --with-all-dependencies (see below for composer.json)

first try i can run it and get into interactive question that drupal/coder has multiple files changed (439) and what i want to do:

y - discard changes and apply the update
n - abort the update and let you manually clean things up
v - view modified files
d - view local modifications (diff)
s - stash changes and try to reapply them after the update
? - print help

i try to choose 'yes', but unfortunately i ran into a problem that patch 86 from zetacomponents/mail can not be applied and the update crashed. This patch seemed to be merged and old composer try to install zetamail in version 1.9.3. I tried to apply the patch manually on the files, but this doesnt work either.

Here is the shortend version of the run through the update to the error. After gathering the patches it got this errormessage, that the patches doesnt apply.

Applying patches for zetacomponents/mail
    https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
    https://github.com/zetacomponents/Mail/pull/86.patch (Allow single quotes to be used in return path)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/zetacomponents/Mail/pull/86.patch

In Patches.php line 326:
                                                                                                                            
  Cannot apply patch Allow single quotes to be used in return path (https://github.com/zetacomponents/Mail/pull/86.patch)!  

Like suggested I provide the composer.json:

{
  "name": "drupal-composer/drupal-project",
  "description": "Project template for Drupal 8 projects with composer",
  "type": "project",
  "license": "GPL-2.0-or-later",
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    }
  ],
  "require": {
    "php": ">=7.0.8",
    "civicrm/civicrm-asset-plugin": "~1.1",
    "civicrm/civicrm-core": "5.49.4",
    "civicrm/civicrm-drupal-8": "5.49.4",
    "civicrm/civicrm-packages": "5.49.4",
    "composer/installers": "^1.2",
    "cweagans/composer-patches": "^1.6.5",
    "drupal/admin_toolbar": "^3.0",
    "drupal/civicrm_entity": "^3.0@beta",
    "drupal/console": "^1.0.2",
    "drupal/content_access": "^1.0@alpha",
    "drupal/context": "^4.1",
    "drupal/core": "^9.0.0",
    "drupal/core-composer-scaffold": "^9",
    "drupal/core-project-message": "^9",
    "drupal/core-recommended": "^9",
    "drupal/entity": "^1.2",
    "drupal/honeypot": "^2.0",
    "drupal/libraries": "^3.0@beta",
    "drupal/role_delegation": "^1.1",
    "drupal/rules": "^3.0@alpha",
    "drupal/token": "^1.10",
    "drupal/typed_data": "^1.0@beta",
    "drupal/upgrade_status": "^3.12",
    "drupal/views_aggregator": "^2.0",
    "drupal/views_data_export": "^1.1",
    "drupal/webform": "^6.1",
    "drupal/webform_civicrm": "^6.0",
    "drush/drush": "^9.7.1 | ^10.0.0",
    "howtomakeaturn/pdfinfo": "1.*",
    "vlucas/phpdotenv": "^4.0",
    "webflo/drupal-finder": "^1.0.0",
    "zaporylie/composer-drupal-optimizations": "^1.0"
  },
  "require-dev": {
    "drupal/core-dev": "^9"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true,
    "allow-plugins": {
      "composer/installers": true,
      "cweagans/composer-patches": true,
      "civicrm/composer-compile-plugin": true,
      "civicrm/composer-downloads-plugin": true,
      "civicrm/civicrm-asset-plugin": true,
      "drupal/console-extend-plugin": true,
      "drupal/core-composer-scaffold": true,
      "drupal/core-project-message": true,
      "zaporylie/composer-drupal-optimizations": true,
      "dealerdirect/phpcodesniffer-composer-installer": true
    }
  },
  "autoload": {
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ],
    "files": [
      "load.environment.php"
    ]
  },
  "scripts": {
    "pre-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "pre-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "post-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ],
    "post-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ]
  },
  "extra": {
    "composer-exit-on-patch-failure": true,
    "patchLevel": {
      "drupal/core": "-p2"
    },
    "drupal-scaffold": {
      "locations": {
        "web-root": "web/"
      }
    },
    "installer-paths": {
      "web/core": [
        "type:drupal-core"
      ],
      "web/libraries/{$name}": [
        "type:drupal-library"
      ],
      "web/modules/contrib/{$name}": [
        "type:drupal-module"
      ],
      "web/profiles/contrib/{$name}": [
        "type:drupal-profile"
      ],
      "web/themes/contrib/{$name}": [
        "type:drupal-theme"
      ],
      "drush/Commands/contrib/{$name}": [
        "type:drupal-drush"
      ]
    },
    "civicrm-asset": {
      "path": "web/libraries/civicrm",
      "url": "/libraries/civicrm",
      "assets:packages": {
        "+include": [
          "kcfinder/**"
        ]
      }
    },
    "enable-patching": "true",
    "compile-whitelist": [
      "civicrm/civicrm-core",
      "civicrm/composer-compile-lib"
    ],
    "compile-mode": "all"
  }
}

I it save to try "composer-exit-on-patch-failure": false or is that safe? I find this question here but there is the Answer that the Patch is not important anymore, but no statement how to get around the Error. Also I am stuck at a place that that the update fail, regardless of the use of composer upgrade or composer update, i cant get to the [y,n,v,d,s,?] decision anymore. Is there a method to get the update done?

2
  • Did you find a solution for that? I keep getting this error but strangely only on our production environment. For all local development versions as well as for the dev/stage remote version this problem does not appear. we just updated to CiviCRM 5.54 but the issue still exists. Commented Oct 13, 2022 at 15:24
  • I used to upgrade civi as @demerit suggested, then i updated drupal. The civi update removes the old zeta patch and then the drupal update works just fine.
    – gzwg
    Commented Oct 15, 2022 at 8:01

1 Answer 1

1

If you can upgrade civi to 5.52+ then do that.

If not you could restrict zeta mail to an earlier version, e.g. composer require zetacomponents/mail:1.9.2, but then remember to remove that from composer.json when you do upgrade civi later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.