Closed yurj closed 1 year ago
I guess return $r;
is missing right after the line
https://github.com/phaidra/phaidra-api/blob/master/PhaidraAPI/Model/Collection.pm#L138.
Related log messages:
[2022/04/15 10:34:34] [ERROR] [6224] [error] Collection->get_members: Cannot get lastModifiedDate!
[2022/04/15 10:34:34] [ERROR] [6224] [error] must specify key at /usr/local/phaidra/phaidra-api/PhaidraAPI/Model/Collection.pm line 217.
I also found that getting members of empty collections isn't cached, probably because $c->app->chi->set($cachekey, $cached_members, '1 day');
doesn't set the cache element when its value is undefined. I think it's not a big deal.
https://github.com/phaidra/phaidra-api/blob/f8d8d59820784c40907f601ad6bfd04b7016c2a1/PhaidraAPI/Controller/Collection.pm#L295
for example:
the call return a json for non collection content types:
the call should return at least an empty json ({}) but would be better to return: