Skip to content

[5.x] Fix "Undefined variable $key" error with Marketplace API Client#10854

Merged
jasonvarga merged 1 commit into
5.xfrom
fix/marketplace-api-lock-timeout
Sep 27, 2024
Merged

[5.x] Fix "Undefined variable $key" error with Marketplace API Client#10854
jasonvarga merged 1 commit into
5.xfrom
fix/marketplace-api-lock-timeout

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

In #10815, we introduced caching and locking around requests to Statamic's Marketplace API.

However, when the lock times out and we want to serve the cached response, an error would occur complainging that the $key variable was undefined. This PR should fix that by defining it outside of the try/catch statement.

@jasonvarga
Copy link
Copy Markdown
Member

Those lines could still be inside the try/catch, they just needed to be before the $lock->block(5).

@jasonvarga jasonvarga merged commit e3a144d into 5.x Sep 27, 2024
@jasonvarga jasonvarga deleted the fix/marketplace-api-lock-timeout branch September 27, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants