- Issue created by @useernamee
- Status changed to Needs review
11 months ago 9:40am 30 January 2024 - 🇳🇱Netherlands casey
In development environments the api key is typically not provided. When the api key is missing currently every drush call triggers at least one " [error] OhDear site id is missing! Fix it ..."
- 🇸🇮Slovenia useernamee Ljubljana
@casey - good point - should we add some checkbox to tell the module that the site is not online? Or maybe we should just handle missing API key differently (e.g. we could move the functionality into submodule).
Are there any good examples from other modules, how they handle similar scenarios?
- Status changed to Needs work
10 months ago 1:32pm 19 February 2024 - 🇸🇮Slovenia useernamee Ljubljana
I've checked the patch.
ohdear_integration.settings
service should be removed as well from services.yml file.
Then from:
- https://git.drupalcode.org/project/ohdear_integration/-/blob/2.x/src/OhD...Otherwise the patch looks good. It just need a few more things to take care of.
- First commit to issue fork.
- Status changed to Needs review
10 months ago 7:19pm 7 March 2024 - 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU
I did the requested, and/but:
- I didn't remove
ohdear_integration.settings
from the service file, because this is a published stable module and its users might be using the service. Instead, there's a deprecation message now. Maybe you can do a followup task for removing them in v3. - I also removed the logger service in the same way. If using a settings object/service is an antipattern, then a logger is an antipattern too. This made me remove the $logger class variable from various classes where it wasn't used.
- fixed phpcs errors because there were few besides code I was already touching anyway.
I hope you don't mind long lines because I just replaced
ohDearIntegrationSettings
withconfigFactory->get('ohdear_integration.settings')
on the same single line.Tested, after a 'drush cr', to make sure I didn't do anything dumb:
- executed getLogger() in
OhDearIntegrationController
andOhDearSdkService::getSiteId()
Did not test:
- casey's change in
OhDearSdkService::getSite()
- because I have no Ohdear API key/settings handy. Reviewed the change, and it looks right / functionally-unchanged to me.
- I didn't remove
- 🇸🇮Slovenia useernamee Ljubljana
Reviewed and it looks good.
Thank you @casey & @roderik for you contributions.
-
useernamee →
committed 607c4b80 on 2.x authored by
roderik →
Issue #3403202 by roderik, casey, useernamee: Dependency injection anti-...
-
useernamee →
committed 607c4b80 on 2.x authored by
roderik →
- Status changed to Fixed
9 months ago 3:20pm 14 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.