Answers.Body: <p>Yes there were patches being applied for php 8.1 compatibility but they are now in the original package so the patches aren't needed anymore.</p>
  <p>See <a href="https://github.com/civicrm/civicrm-core/pull/24198" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/24198</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-11T06:17:29.513Z
Answers.Text: ah... thank you for this info
Answers.UserDisplayName: Tobias Krause
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-11T15:41:22.170Z
Answers.Text: This pull request is against 5.53. What about updating 5.51 or 5.52? Or will this get into the next 5.51.x and 5.52.x release anyway?
Answers.UserDisplayName: Timotheus Pokorra
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-11T15:51:14.990Z
Answers.Text: 5.52 backport is merged. There likely won't be one for 5.51 since it's annoying but not critical.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-22T11:45:42.780Z
Answers.Text: Thank you for this... unfortunately this worked now for me locally and in our dev environment but on production I still get this error. Do you have any idea why the exact same composer.json works on dev but not on production? PHP version and composer version are the same
Answers.UserDisplayName: Tobias Krause
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-10T11:42:05.753Z
Answers.LastActivityDate: 2022-08-10T11:42:05.753Z
Answers.UserDisplayName: Demerit
Body: <p>Currently on CiviCRM 5.51.1 with Drupal 9.4.3 and PHP 8.0. I wanted to update CiviCRM but no matter if I try to update to 5.51.3 or 5.52 - I get the composer error:</p>
  <pre><code> 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://g
    ithub.com/zetacomponents/Mail/pull/86.patch)!
  </code></pre>
  <p>This is the composer.json with which I run composer update:</p>
  <pre><code>{
      &quot;name&quot;: &quot;abgeordnetenwatch/civicrm&quot;,
      &quot;description&quot;: &quot;This composer.json is based on the composer.json of drupal-composer/drupal-project and meets the needs of our CiviCRM installaion&quot;,
      &quot;type&quot;: &quot;project&quot;,
      &quot;license&quot;: &quot;GPL-2.0-or-later&quot;,
      &quot;authors&quot;: [
          {
              &quot;name&quot;: &quot;Tobias Krause&quot;,
              &quot;role&quot;: &quot;Lead developer&quot;,
              &quot;email&quot;: &quot;krause@abgeordnetenwatch.de&quot;
          }
      ],
      &quot;repositories&quot;: [
          {
              &quot;type&quot;: &quot;composer&quot;,
              &quot;url&quot;: &quot;https://packages.drupal.org/8&quot;
          }
      ],
      &quot;require&quot;: {
          &quot;php&quot;: &quot;&gt;=7.3&quot;,
          &quot;civicrm/civicrm-asset-plugin&quot;: &quot;~1.0&quot;,
          &quot;civicrm/civicrm-core&quot;: &quot;^5.50.0&quot;,
          &quot;civicrm/civicrm-drupal-8&quot;: &quot;^5.50.0&quot;,
          &quot;civicrm/civicrm-packages&quot;: &quot;^5.50.0&quot;,
          &quot;civicrm/cv&quot;: &quot;^0.3.20&quot;,
          &quot;composer/installers&quot;: &quot;^1.9&quot;,
          &quot;cweagans/composer-patches&quot;: &quot;^1.7&quot;,
          &quot;drupal/admin_toolbar&quot;: &quot;^3.0&quot;,
          &quot;drupal/civicrm_drush&quot;: &quot;^1.2&quot;,
          &quot;drupal/config_split&quot;: &quot;^2.0&quot;,
          &quot;drupal/core-composer-scaffold&quot;: &quot;^9.4&quot;,
          &quot;drupal/core-recommended&quot;: &quot;^9.4&quot;,
          &quot;drupal/smtp&quot;: &quot;^1.0&quot;,
          &quot;drush/drush&quot;: &quot;^10.6&quot;,
          &quot;vlucas/phpdotenv&quot;: &quot;^5.1&quot;,
          &quot;webflo/drupal-finder&quot;: &quot;^1.2&quot;
      },
      &quot;require-dev&quot;: {
          &quot;drupal/core-dev&quot;: &quot;^9.4&quot;,
          &quot;drupal/devel&quot;: &quot;^4.0&quot;
      },
      &quot;conflict&quot;: {
          &quot;drupal/drupal&quot;: &quot;*&quot;
      },
      &quot;minimum-stability&quot;: &quot;dev&quot;,
      &quot;prefer-stable&quot;: true,
      &quot;config&quot;: {
          &quot;discard-changes&quot;: true,
          &quot;sort-packages&quot;: true,
          &quot;allow-plugins&quot;: {
              &quot;composer/installers&quot;: true,
              &quot;cweagans/composer-patches&quot;: true,
              &quot;drupal/core-composer-scaffold&quot;: true,
              &quot;dealerdirect/phpcodesniffer-composer-installer&quot;: true,
              &quot;civicrm/composer-compile-plugin&quot;: true,
              &quot;civicrm/composer-downloads-plugin&quot;: true,
              &quot;civicrm/civicrm-asset-plugin&quot;: true
          }
      },
      &quot;autoload&quot;: {
          &quot;classmap&quot;: [
              &quot;scripts/composer/ScriptHandler.php&quot;
          ],
          &quot;files&quot;: [&quot;httpdocs/load.environment.php&quot;]
      },
      &quot;scripts&quot;: {
          &quot;pre-install-cmd&quot;: [
              &quot;DrupalProject\\composer\\ScriptHandler::checkComposerVersion&quot;
          ],
          &quot;pre-update-cmd&quot;: [
              &quot;DrupalProject\\composer\\ScriptHandler::checkComposerVersion&quot;
          ],
          &quot;post-install-cmd&quot;: [
              &quot;DrupalProject\\composer\\ScriptHandler::createRequiredFiles&quot;
          ],
          &quot;post-update-cmd&quot;: [
              &quot;DrupalProject\\composer\\ScriptHandler::createRequiredFiles&quot;
          ]
      },
      &quot;extra&quot;: {
          &quot;composer-exit-on-patch-failure&quot;: true,
          &quot;patchLevel&quot;: {
              &quot;drupal/core&quot;: &quot;-p2&quot;
          },
          &quot;drupal-scaffold&quot;: {
              &quot;locations&quot;: {
                  &quot;web-root&quot;: &quot;httpdocs/&quot;
              },
              &quot;file-mapping&quot;: {
                  &quot;[web-root]/robots.txt&quot;: false,
                  &quot;[web-root]/sites/development.services.yml&quot;: false,
                  &quot;[web-root]/INSTALL.txt&quot;: false,
                  &quot;[web-root]/README.txt&quot;: false,
                  &quot;[web-root]/example.gitignore&quot;: false,
                  &quot;[web-root]/.htaccess&quot;: false,
                  &quot;[web-root]/sites/default/settings.php&quot;: false
              }
          },
          &quot;installer-paths&quot;: {
              &quot;httpdocs/core&quot;: [&quot;type:drupal-core&quot;],
              &quot;httpdocs/libraries/{$name}&quot;: [&quot;type:drupal-library&quot;],
              &quot;httpdocs/modules/contrib/{$name}&quot;: [&quot;type:drupal-module&quot;],
              &quot;httpdocs/profiles/contrib/{$name}&quot;: [&quot;type:drupal-profile&quot;],
              &quot;httpdocs/themes/contrib/{$name}&quot;: [&quot;type:drupal-theme&quot;],
              &quot;drush/Commands/{$name}&quot;: [&quot;type:drupal-drush&quot;]
          },
          &quot;patches&quot;: {
          },
          &quot;civicrm-asset&quot;: {
              &quot;path&quot;: &quot;httpdocs/libraries/civicrm&quot;,
              &quot;url&quot;: &quot;/libraries/civicrm&quot;,
              &quot;assets:core&quot;: {
                  &quot;include&quot;: [&quot;js/**&quot;, &quot;css/**&quot;, &quot;ang/**&quot;, &quot;templates/**.png&quot;, &quot;templates/**.jpg&quot;, &quot;ext/ckeditor4/js/ck-options.json&quot;],
                  &quot;exclude-dir&quot;: [&quot;.git&quot;, &quot;/CRM&quot;]
              }
          },
          &quot;enable-patching&quot;: &quot;true&quot;,
          &quot;compile-whitelist&quot;: [&quot;civicrm/civicrm-core&quot;, &quot;civicrm/composer-compile-lib&quot;]
      }
  }
  </code></pre>
  <p>One week ago I just used the same composer.json with composer update without any problems.</p>
  
Tags: <upgrade><composer>
Title: Update CiviCRM with composer fails during patching: "Cannot apply patch Allow single quotes to be used in return path"
ThreadText: # Update CiviCRM with composer fails during patching: "Cannot apply patch Allow single quotes to be used in return path"
  
  (Asked by: username_0 on 2022-08-10)
  
  Currently on CiviCRM 5.51.1 with Drupal 9.4.3 and PHP 8.0. I wanted to update CiviCRM but no matter if I try to update to 5.51.3 or 5.52 - I get the composer error:
  
  ```
   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://g
    ithub.com/zetacomponents/Mail/pull/86.patch)!
  
  ```
  
  This is the composer.json with which I run composer update:
  
  ```
  {
      "name": "abgeordnetenwatch/civicrm",
      "description": "This composer.json is based on the composer.json of drupal-composer/drupal-project and meets the needs of our CiviCRM installaion",
      "type": "project",
      "license": "GPL-2.0-or-later",
      "authors": [
          {
              "name": "username_0 username_0",
              "role": "Lead developer",
              "email": "username_0@abgeordnetenwatch.de"
          }
      ],
      "repositories": [
          {
              "type": "composer",
              "url": "https://packages.drupal.org/8"
          }
      ],
      "require": {
          "php": ">=7.3",
          "civicrm/civicrm-asset-plugin": "~1.0",
          "civicrm/civicrm-core": "^5.50.0",
          "civicrm/civicrm-drupal-8": "^5.50.0",
          "civicrm/civicrm-packages": "^5.50.0",
          "civicrm/cv": "^0.3.20",
          "composer/installers": "^1.9",
          "cweagans/composer-patches": "^1.7",
          "drupal/admin_toolbar": "^3.0",
          "drupal/civicrm_drush": "^1.2",
          "drupal/config_split": "^2.0",
          "drupal/core-composer-scaffold": "^9.4",
          "drupal/core-recommended": "^9.4",
          "drupal/smtp": "^1.0",
          "drush/drush": "^10.6",
          "vlucas/phpdotenv": "^5.1",
          "webflo/drupal-finder": "^1.2"
      },
      "require-dev": {
          "drupal/core-dev": "^9.4",
          "drupal/devel": "^4.0"
      },
      "conflict": {
          "drupal/drupal": "*"
      },
      "minimum-stability": "dev",
      "prefer-stable": true,
      "config": {
          "discard-changes": true,
          "sort-packages": true,
          "allow-plugins": {
              "composer/installers": true,
              "cweagans/composer-patches": true,
              "drupal/core-composer-scaffold": true,
              "dealerdirect/phpcodesniffer-composer-installer": true,
              "civicrm/composer-compile-plugin": true,
              "civicrm/composer-downloads-plugin": true,
              "civicrm/civicrm-asset-plugin": true
          }
      },
      "autoload": {
          "classmap": [
              "scripts/composer/ScriptHandler.php"
          ],
          "files": ["httpdocs/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": "httpdocs/"
              },
              "file-mapping": {
                  "[web-root]/robots.txt": false,
                  "[web-root]/sites/development.services.yml": false,
                  "[web-root]/INSTALL.txt": false,
                  "[web-root]/README.txt": false,
                  "[web-root]/example.gitignore": false,
                  "[web-root]/.htaccess": false,
                  "[web-root]/sites/default/settings.php": false
              }
          },
          "installer-paths": {
              "httpdocs/core": ["type:drupal-core"],
              "httpdocs/libraries/{$name}": ["type:drupal-library"],
              "httpdocs/modules/contrib/{$name}": ["type:drupal-module"],
              "httpdocs/profiles/contrib/{$name}": ["type:drupal-profile"],
              "httpdocs/themes/contrib/{$name}": ["type:drupal-theme"],
              "drush/Commands/{$name}": ["type:drupal-drush"]
          },
          "patches": {
          },
          "civicrm-asset": {
              "path": "httpdocs/libraries/civicrm",
              "url": "/libraries/civicrm",
              "assets:core": {
                  "include": ["js/**", "css/**", "ang/**", "templates/**.png", "templates/**.jpg", "ext/ckeditor4/js/ck-options.json"],
                  "exclude-dir": [".git", "/CRM"]
              }
          },
          "enable-patching": "true",
          "compile-whitelist": ["civicrm/civicrm-core", "civicrm/composer-compile-lib"]
      }
  }
  
  ```
  
  One week ago I just used the same composer.json with composer update without any problems.
  
  **Tags:** upgrade, composer
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-08-10. Score: 2 | Accepted answer
  
  Yes there were patches being applied for php 8.1 compatibility but they are now in the original package so the patches aren't needed anymore.
  
  See <https://github.com/civicrm/civicrm-core/pull/24198>
  
  > **Comments:**
  > **username_0**: ah... thank you for this info  
  > **username_2**: This pull request is against 5.53. What about updating 5.51 or 5.52? Or will this get into the next 5.51.x and 5.52.x release anyway?  
  > **username_1**: 5.52 backport is merged. There likely won't be one for 5.51 since it's annoying but not critical.  
  > **username_0**: Thank you for this... unfortunately this worked now for me locally and in our dev environment but on production I still get this error. Do you have any idea why the exact same composer.json works on dev but not on production? PHP version and composer version are the same  
  
  ---
  
  