apigee / apigee-edge-drupal

The Apigee Edge module enables you to integrate a Drupal 9 or 8 site with Apigee.
https://www.drupal.org/project/apigee_edge
GNU General Public License v2.0
32 stars 45 forks source link

OAuth Patch for Apigee Edge Client Library for PHP not getting applied #42

Closed cnovak closed 6 years ago

cnovak commented 6 years ago
Q A
Bug? yes
New Feature? no
Version 1.0.0-alpha4

Summary

The OAuth Patch for Apigee Edge Client Library for PHP is not getting installed when we run composer.

Steps to Reproduce the behavior

  1. Have a Drupal 8 site running with the apigee_edge module 1.0.0-alpha4 running. Noticed that the patch for OAuth is not installed as the Apigee Client for PHP says it should be if using composer patches.
  2. Ran composer update apigee/apigee-client-php, but the patch was not installed.
  3. Ran composer update drupal/apigee_edge, but the patch was not installed.
  4. Ran composer remove drupal/apigee_edge and then composer require drupal/apigee_edge and the patch was not installed.

What are the steps to get the patch installed on a currently running system? If I reinstall a brand new site, will the patch get applied?

cnovak commented 6 years ago

I originally posted this issue in wrong issue queue, moving it here. @mxr576 made the following comment in response:

Hi, This is not a apigee-client-php issue so it should have been posted rather here: https://github.com/apigee/apigee-edge-drupal.

Have you installed cweagans/composer-patches as a dependency? Have you enabled automatic patching in Drupal's composer.json?

    "extra": {
        "enable-patching": true,
        "patchLevel": {
            "drupal/core": "-p2"
        }
    }

If you did when you do composer require drupal/apigee_edge you should see the following output on the screen.

output.txt

- Applying patches for php-http/client-common https://patch-diff.githubusercontent.com/raw/php-http/client-common/pull/103.diff (Only add path prefix if the path does not contain it already #103)

So patch is being applied on PHP API Client's dependency.

However, it seems drupal/core patches has not been applied for some reasons for the first run - I'll look into that - so you have to run composer update none to ensure those get applied too.

cnovak commented 6 years ago

Thanks @mxr576 , I now realize I need to add enable-patching": true and patchLevel to get the patches to apply. We should add this to the installation instructions.

mxr576 commented 6 years ago

Enabling patching is not enough, because Drupal core patches does not get applied in the first time when our module gets installed unless you do not run "composer update --lock" after "composer require drupal/apigee_edge". See https://github.com/cweagans/composer-patches/issues/219

https://github.com/wikimedia/composer-merge-plugin has to be installed and configured properly to make this work.

I created a "composer kickstart" project that has everything configured properly: https://github.com/mxr576/apigee_devportal_composer_kickstart

mxr576 commented 6 years ago

Closing this issue because of no activity.