Hi there,
After configuring module getting following error , due to can not upload files. Drupal\acquia_dam\AcquiadamAuthService::refreshAccessToken():
Thanks for help
Issue fork acquia_dam-3360415
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mglamanWhat is the exact error? This is just a class and method name.
Comment #3
capysara commentedI'm getting
TypeError: Drupal\acquia_dam\AcquiadamAuthService::refreshAccessToken(): Argument #1 ($refresh_token) must be of type string, null given, called in /app/docroot/modules/contrib/acquia_dam/src/Client/AcquiaDamClientFactory.php on line 175 in Drupal\acquia_dam\AcquiadamAuthService->refreshAccessToken() (line 309 of /app/docroot/modules/contrib/acquia_dam/src/AcquiadamAuthService.php)Comment #5
capysara commentedI'm hitting that error because I'm having issues connecting today. I made a MR that checks to be sure that the user has a token. After I add that, I'm still not able to connect, but the media library modal opens and there's a message:
Something went wrong contacting Acquia DAM, the search could not be completed.Comment #6
capysara commentedComment #7
mglamanThanks for helping explain the error, this seems reasonable if it's a type error.
Comment #8
capysara commentedUpdated the MR. Is that the right fix for this?
I also added the check to getRefreshToken and removed "?" from "?string" because it shouldn't return null.
Comment #9
mglamanThat looks right! Thank you for making the fix. This is in our sprint right now, so I'll review it and get it committed.
Comment #10
mglamanYep, this looks great. It fixes passing null to
\Drupal\acquia_dam\AcquiadamAuthService::refreshAccessTokenand removesnull|stringfrom those two methods.But now I'm concerned that the OAuth refresh middleware is running when it isn't supposed to, and that's why we saw this bug.
Comment #11
mglamanThe error lies here:
We can get a 401 unauthorized request before the site is configured. The code doesn't check
auth_type. It assumes a refresh token should be used on 401.Comment #13
mglamanMerged! We'll have a release soon with the fix. Thanks @capysara.