Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for the transient's name in Eventbrite Manager. #37



Copy link

@wvega wvega commented Sep 13, 2015

Hi everyone,

Thank you for this great plugin. It definitely saved me a lot of time last week!

Recently, I had to use Eventbrite API in a server that runs a 32-bit build of PHP. As you know, the events IDs from Eventbrite cannot be represented as a 32-bit integers, causing problems with most of the plugin's features.

I was able to get most of the features I need working, using filters and actions to insert the original ID in the necessary places. The details are here. My approach does not solve all the problems, but was almost enough for us.

Unfortunately, there is one more problem that I don't think I can solve using existing hooks. When the Event Manager creates the transient name to cache the results of a request to the event_details endpoint, the value stored in the p index of the parameters array is set to 2147483647 no matter which event is being queried.

In my website, the requests ultimately returns the desired information, because I update the endpoint's URL to include the real ID, but Event Manager is not aware of that modification and as a result all my single event pages are showing information for the same event: the cached version of whichever event was requested first.

The commit in this PR adds a filter in the get_transient_name method of Event Manager class, that will allow me to generate a transient name using the real event ID, preventing the problem I just explained.

Is it possible to add that filter to the plugin?

I've been trying to solve the issues I found without touching the plugin's code, and that filter is, I think, the last piece of the puzzle. If you merge this PR, I can update my copy of Eventbrite API with the same modifications, knowing the next version will officially introduce the filter, thus making sure my solution will continue to be compatible.

Thank you!

kwight added a commit that referenced this pull request Sep 14, 2015
Add filter for the transient's name in Eventbrite Manager.
@kwight kwight merged commit cc0ff7b into Automattic:master Sep 14, 2015
Copy link

kwight commented Sep 14, 2015

Well done @wvega , thanks – it will be part of the next release. Thanks for the PR, and the writeup is great too; will certainly be pointing some people that way.

Copy link
Contributor Author

wvega commented Sep 14, 2015

Thank you @kwight for merging the PR so quickly 👍. I already updated the post to include a new workaround using the filter.

@wvega wvega deleted the feature/add-filter-for-transient-name branch Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants