Odd code (assign instead compare) in function borg_project_metrics_get_metrics()
This is really odd. It may be by intention, but I really doubt it.
https://github.com/backdrop-ops/backdropcms.org/blob/main/www/modules/custom/borg_project_metrics/borg_project_metrics.module#L194-L196
Could it be that this was supposed to be elseif ($type == 'comments') { instead?
Don't wait for me, I won't provide a PR for it. :wink: Just have a look - who's more familiar with the code.
Sure looks like it ought to be ==. @jenlampton, would you agree?
It might as well be, that this was supposed to be:
else {
$type = 'comments';
...
Something needs to be assigned to $type because further down in the function it's assumed it exists, and also that $url is set, of course.
I belief, the code works as intended - it's just written in a confusing way.
Yes, I think that was supposed to be == .