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

Missing timezone information when using the MaxMind driver #160

Closed
craigpaul opened this issue Jan 28, 2024 · 2 comments · Fixed by #161
Closed

Missing timezone information when using the MaxMind driver #160

craigpaul opened this issue Jan 28, 2024 · 2 comments · Fixed by #161

Comments

@craigpaul
Copy link

When using the MaxMind driver in your package, I've encountered an issue where the timezone field becomes null during the processing of the IP. This problem specifically occurs in the hydrate method of the driver when transferring information from the Fluent object to the Position object.

The underscore in the property name seems to be the root cause, as the actual property on the Fluent class is named timezone without the underscore. To address this issue in my application, I implemented a temporary workaround by overriding the driver's hydrate method as follows:

/**
 * {@inheritdoc}
 */
protected function hydrate(Position $position, Fluent $location): Position
{
    $position = parent::hydrate($position, $location);

    $position->timezone = $location->timezone;

    return $position;
}

I believe a fix for this issue could involve updating the driver and related tests, and I can put up a pull request if this approach aligns with the project's goals. Please let me know if you have any thoughts or feedback on this proposed solution.

Thank you for your time and consideration.

@stevebauman
Copy link
Owner

Hi @craigpaul, thanks for the post!

Will definitely accept a PR if you send one over 🙏

@craigpaul
Copy link
Author

Awesome! Thanks @stevebauman! I'll send that over tonight when I get back home 😄

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 a pull request may close this issue.

2 participants