Below is composer.json

composer update

but unable to applied patch

{
    "name": "pantheon-upstreams/drupal-composer-managed",
    "description": "Install Drupal 9 with Composer on Pantheon.",
    "type": "project",
    "license": "MIT",
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "path",
            "url": "upstream-configuration"
        }
    ],
    "require": {
        "pantheon-upstreams/upstream-configuration": "dev-main",
        "composer/installers": "^1.9",
        "drupal/core-composer-scaffold": "^9.2",
        "drupal/core-recommended": "^9.2",
        "pantheon-systems/drupal-integrations": "^9",
        "cweagans/composer-patches": "^1.7",
        "drush/drush": "^11 || ^12",
        "drupal/menu_token": "^9.1@alpha",
        "drupal/devel_kint_extras": "^1.0"
    },
    "require-dev": {
        "drupal/core-dev": "^9.2"
    },
    "conflict": {
            "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "./web"
            },
            "allowed-packages": [
                "pantheon-systems/drupal-integrations"
            ],
            "file-mapping": {
                "[project-root]/.editorconfig": false,
                "[project-root]/pantheon.upstream.yml": false,
                "[project-root]/.gitattributes": false
            }
        },
        "installer-types": [
           "npm-asset",
           "bower-asset"
        ],
        "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"],
            "web/modules/custom/{$name}": ["type:drupal-custom-module"],
            "web/profiles/custom/{$name}": ["type:drupal-custom-profile"],
            "web/themes/custom/{$name}": ["type:drupal-custom-theme"],
            "web/private/scripts/quicksilver/{$name}/": ["type:quicksilver-script"]
        },
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "enable-patching": true,
        "patches": {
         "drupal/menu_token": {
            "Passing null to parameter #2 ($subject) of type string is deprecated": "https://www.drupal.org/files/issues/2022-07-18/ASGS-4866-php8-compatibility_3.patch"
         }
        }

    },
    "autoload": {
        "classmap": [
            "upstream-configuration/scripts/ComposerScripts.php"
        ]
    },
    "scripts": {
        "pre-update-cmd": [
            "DrupalComposerManaged\\ComposerScripts::preUpdate"
        ],
        "upstream-require": [
            "DrupalComposerManaged\\ComposerScripts::upstreamRequire"
        ]
    },
    "scripts-descriptions": {
        "upstream-require": "Add a dependency to an upstream. See https://pantheon.io/docs/create-custom-upstream for information on creating custom upstreams."
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": false,
        "platform": {
            "php": "8.1"
        },
        "allow-plugins": {
            "composer/installers": true,
            "cweagans/composer-patches": true,
            "drupal/core-composer-scaffold": true,
            "dealerdirect/phpcodesniffer-composer-installer": true
        }
    }
}

Comments

pankaj1390 created an issue. See original summary.

pankaj1390’s picture

Issue summary: View changes
larowlan’s picture

Category: Bug report » Support request
cilefen’s picture

Status: Active » Fixed

You did not provide the full output, which is:

Applying patches for drupal/menu_token
    https://www.drupal.org/files/issues/2022-07-18/ASGS-4866-php8-compatibility_3.patch (Passing null to parameter #2 ($subject) of type string is deprecated)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-07-18/ASGS-4866-php8-compatibility_3.patch

That means exactly what it says: that patch file does not apply to drupal/menu_token. That is something you must investigate on your end.

pankaj1390’s picture

@cilefen below error showing: when I run update.php

Deprecated function: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\Core\Utility\Token->scan() (line 295 of core/lib/Drupal/Core/Utility/Token.php).

Drupal\Core\Utility\Token->scan(NULL) (Line: 64)
Drupal\menu_token\Service\MenuTokenContextManager->prepareContextualLinks(Array, Array) (Line: 451)
menu_token_menu_links_discovered_alter(Array, NULL, NULL) (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('menu_links_discovered', Array) (Line: 166)
Drupal\Core\Menu\MenuLinkManager->getDefinitions() (Line: 189)
Drupal\Core\Menu\MenuLinkManager->rebuild() (Line: 82)
Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild() (Line: 70)
Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild(Object, 'routing.route_finished', Object)
call_user_func(Array, Object, 'routing.route_finished', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'routing.route_finished') (Line: 197)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 587)
drupal_flush_all_caches() (Line: 662)
Drupal\system\Controller\DbUpdateController::batchFinished(1, Array, Array, '6 sec') (Line: 456)
_batch_finished() (Line: 98)
_batch_page(Object) (Line: 186)
Drupal\system\Controller\DbUpdateController->handle('start', Object)
call_user_func_array(Array, Array) (Line: 115)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 76)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 27)

cilefen’s picture

This is not a support forum. That is a new question. Menu Token is alpha quality software. You should ask there.

Status: Fixed » Closed (fixed)

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