- Issue created by @mglaman
- 🇦🇹Austria drunken monkey Vienna, Austria
drunken monkey → made their first commit to this issue’s fork.
- Merge request !222Change Server::setBackendConfig() to always call the backend plugin's setConfiguration() method → (Merged) created by drunken monkey
- 🇦🇹Austria drunken monkey Vienna, Austria
Sure, that seems sensible. Thanks a lot for the suggestion!
I created an MR with your exact code. Feel free to give it a try. I’d also appreciate feedback from anyone else that wants to weigh in, otherwise I’d just merge it in a week or two.There is a slight API change here in that
setBackendConfig()
can now throw an exception, but I feel like that shouldn’t really matter in the real world. But I might still want to add a change record for this, just to be on the safe side – not sure yet. - 🇦🇹Austria drunken monkey Vienna, Austria
Changed my mind, let’s not throw an exception after all. Doesn’t really add any value there, I’d say.
- 🇺🇸United States mglaman WI, USA
Looks good, and thanks! Makes sense to swallow up the exception for now. If other folks start doing more with recipes and find it useful it can be argued to fail loudly for DX around building recipes.
Thanks for making the MR, had to move on and didn't have time to open one.
- 🇦🇹Austria drunken monkey Vienna, Austria
Running this locally with XDebug enabled makes it immediately clear why PHPUnit fails to finish: The current code actually leads to an infinite loop, as the default method implementation
\Drupal\search_api\Backend\BackendPluginBase::setConfiguration()
actually calls$this->server->setBackendConfig()
. Our current code actually already guarded against this, so that the config stays in sync no matter which method you call but you should still never get an infinite loop.
So, let’s just remove one condition from theif
check and add thetry
/catch
and that should fix all that.Please test/review again!
- 🇺🇸United States thejimbirch Cape Cod, Massachusetts
Adding tag so I can update the config action documentation when this lands.
Also asked Artem to review in the Drupal Slack.
- 🇩🇪Germany a.dmitriiev
I have checked with the "real" recipe to use the config action to set the backend config and everything worked properly.
-
drunken monkey →
committed 40d9fa0b on 8.x-1.x
Issue #3516711 by drunken monkey, mglaman: Fixed Server::...
-
drunken monkey →
committed 40d9fa0b on 8.x-1.x
- 🇦🇹Austria drunken monkey Vienna, Austria
Great to hear, thanks for the feedback!
Merged.
Thanks again, everyone! Automatically closed - issue fixed for 2 weeks with no activity.