0

I am unable to apply patch using composer in Drupal core 8.6.4. Can anyone help me to apply patch using composer? Here is the process what I am doing :

{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
    "composer/installers": "^1.0.24",
    "wikimedia/composer-merge-plugin": "^1.4",
    "drupal/admin_toolbar": " ^1.25",
    "drupal/config_ignore": "^2.1",
    "drupal/config_split": "^1.4",
    "drupal/devel": "^1.2",
    "drupal/paragraphs": "^1.5",
    "drupal/pathauto": "^1.3",
    "drupal/s3fs": "^3.0-alpha13",
    "drupal/field_group": "^3.0-beta1",
    "drush/drush": "^9.4",
    "drupal/backup_migrate": "^4.0",
    "drupal/restui": "^1.16",
    "drupal/conditional_fields": "^1.0-alpha4",
    "drupal/ckeditor_font": "^1.0",
    "drupal/colorbutton": "^1.1",
    "library-ckeditor/panelbutton": "^4.11",
    "library-ckeditor/colorbutton": "4.11.1",
    "drupal/migrate_plus": "^4.1",
    "drupal/migrate_tools": "^4.1",
    "drupal/migrate_source_csv": "^2.2",
    "drupal/migrate_file": "^1.1",
    "drupal/taxonomy_import": "^1.0",
    "drupal/metatag": "^1.7",
    "predis/predis" : "^1.1.1",
    "drupal/rabbitmq": "^1.1",
    "php-amqplib/rabbitmq-bundle": "^1.14",
    "drupal/ultimate_cron":"^2.0-alpha4",
    "cweagans/composer-patches": "~1.0"
},
"require-dev": {
    "asm89/twig-lint": "^1.0",
    "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
    "drupal/coder": "^8.2.12"
},
"replace": {
    "drupal/core": "^8.6"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
    "preferred-install": "dist",
    "autoloader-suffix": "Drupal8"
},
"extra": {
    "_readme": [
        "By default Drupal loads the autoloader from ./vendor/autoload.php.",
        "To change the autoloader you can edit ./autoload.php.",
        "This file specifies the packages.drupal.org repository.",
        "You can read more about this composer repository at:",
        "https://www.drupal.c/node/2718229"
    ],
    "merge-plugin": {
        "include": [
            "core/composer.json"
        ],
        "recurse": true,
        "replace": false,
        "merge-extra": false
    },
    "installer-paths": {
        "core": ["type:drupal-core"],
        "modules/contrib/{$name}": ["type:drupal-module"],
        "profiles/contrib/{$name}": ["type:drupal-profile"],
        "themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"],
        "modules/custom/{$name}": ["type:drupal-custom-module"],
        "themes/custom/{$name}": ["type:drupal-custom-theme"]
    },
    "enable-patching": true,
    "patches": {
        "drupal/core": {
            "Search autocomplete from views result": "https://www.drupal.org/files/issues/2019-01-10/2174633-238.patch"
        }
    }
},
"autoload": {
    "psr-4": {
        "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
    }
},
"scripts": {
    "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
    "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
    "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
    "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
    "drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
    "drupal-phpunit-upgrade": "@composer update phpunit/phpunit phpspec/prophecy symfony/yaml --with-dependencies --no-progress",
    "phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
    "phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
    {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
    },
    {
        "type": "package",
        "package": {
            "name": "library-ckeditor/panelbutton",
            "version": "4.11.1",
            "type": "drupal-library",
            "dist": {
                "url": "https://download.ckeditor.com/panelbutton/releases/panelbutton_4.11.1.zip",
                "type": "zip"
            }
        }
    },
    {
        "type": "package",
        "package": {
            "name": "library-ckeditor/colorbutton",
            "version": "4.11.1",
            "type": "drupal-library",
            "dist": {
                "url": "https://download.ckeditor.com/colorbutton/releases/colorbutton_4.11.1.zip",
                "type": "zip"
            }
        }
    }
]

}

Command: composer install - but nothing happens.

5
  • Unless the patches plugin doesn't provide a composer apply-patches command or similar, you can simply delete your composer.lock file prior to composer install. Off-topic.
    – leymannx
    Commented Apr 5, 2019 at 12:48
  • Yes, I have tried. Even I have also tried composer update --lock but nothing happens. Commented Apr 5, 2019 at 13:11
  • 1
    Ain't the drupal/drupal project's outdated and must be converted using grasmash/composerize-drupal. Can you check that?
    – leymannx
    Commented Apr 5, 2019 at 13:31
  • 1
    Thanks, @leymannx for your suggestion. I got the issue and it is working fine. Actually, I am trying to apply the patch on core files so need to add this in require not in replace. Ex : "replace": { "drupal/core": "^8.6" } should be in "require": { "drupal/core": "^8.6", "composer/installers": "^1.0.24",} Commented Apr 6, 2019 at 19:21
  • How did you get this working?
    – user1359
    Commented May 8, 2019 at 17:56

1 Answer 1

1

You need 'composer require cweagans/composer-patches' in order to apply patches.

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.