How to apply patches to a distribution via the composer workflow

Created on 31 October 2016, about 8 years ago
Updated 4 March 2024, 9 months ago

hi there,

i'm trying to play with open social, but ran into the following bug during install: #2822893: CommerceGuys\Intl\Country\CountryRepository causes failure on install β†’

now my question is, how to best apply/test such a patch with the distribution. do you have any documentation / guidance available or can point me to the proper composer workflow?

what i tried was installing the distro and then adding a package that depends on the feature branch into the top level composer.json

        {
            "type":"package",
            "package": {
                "name": "dev/open_social",
                "version": "1.0.0-beta4",
                "type": "drupal-profile",
                "source": {
                    "type": "git",
                    "url": "https://github.com/goalgorilla/open_social.git",
                    "reference": "feature/DS-2326-2822828-address"
                }
            }
        },

but you will end up with the following error

  [ErrorException]                                                                                             
  Argument 1 passed to Composer\Installer\InstallationManager::getInstallPath() must implement interface Comp  
  oser\Package\PackageInterface, null given, called in /Users/dasjo/am/opensocial/DIRECTORY/vendor/drupal-com  
  poser/drupal-scaffold/src/Handler.php on line 210 and defined                                                

thanks :)

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code (back-end)

Created by

πŸ‡¨πŸ‡­Switzerland dasjo Zurich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡­Switzerland colorfield Lausanne

    Very late to the party, but if you are landing here, just target goalgorilla/open_social

    Example in your composer.json

    "patches": {
      "goalgorilla/open_social": {
        "Issue": "https://www.drupal.org/[my-patch.patch]"
      }
    },
    

    Where the patch targets

    a/modules/social_features/social_*/files_to_patch
    b/modules/social_features/social_*/files_to_patch

  • πŸ‡ΊπŸ‡¦Ukraine 32i

    @colorfield Thank you so much, this helped a lot, wasn't obvious to me when installed from the template.

Production build 0.71.5 2024