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

Check configured variables for availability in GeoIP2 server module #12892

Merged
merged 6 commits into from May 22, 2018

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented May 11, 2018

Otherwise it's difficult to enable the module on nginx, as MMDB_ADDR or MMDB_INFO variables needs to be defined, which isn't the case.

See https://forum.matomo.org/t/geoip2-system-check-like/28251

@sgiehl sgiehl added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review labels May 11, 2018
@sgiehl sgiehl added this to the 3.5.1 milestone May 11, 2018
@diosmosis
Copy link
Member

UI test failures seem unrelated, but not sure why it fails w/ plugin_setting table does not exist...

@diosmosis
Copy link
Member

Ok, found out why the UI tests fail:
image

Looks like the ConvertRegionCodesToIso command's isEnabled() method gets the current provider which tries to get the getGeoIpServerVars() system setting, but since the test database is being used, and it hasn't been created/setup yet, an exception is thrown.

Think a quick fix would be to just disable the command if PIWIK_TEST_MODE is defined.

@sgiehl sgiehl force-pushed the geoip2servermodule branch 2 times, most recently from fa17743 to b5a5d89 Compare May 18, 2018 13:41
foreach ($systemSettings->geoIp2variables as $name => $setting) {
$settingValues[$name] = $setting->getValue();
}
} catch (\Exception $e) {
}

$cache->save($cacheKey, $settingValues);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to save these values in the cache if getting the system settings fails?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should only occur in tests. But guess it's better not to cache on failure

@diosmosis diosmosis merged commit 55b39d9 into 3.x-dev May 22, 2018
@diosmosis diosmosis deleted the geoip2servermodule branch May 22, 2018 18:58
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
…atomo-org#12892)

* Check configured variables for availability in GeoIP2 server module

* Update system test expected files.

* catch exception for tests

* do not cache on failure

* Update expected admin screenshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants