set _api_write_item_iri only if result object is a subclass of a resource class#2810
set _api_write_item_iri only if result object is a subclass of a resource class#2810Perf wants to merge 3 commits into
Conversation
|
Could you please use descriptive commit messages and update the title of this issue so it can be searched/indexed properly in the future? Thanks! :) |
|
The fix is wrong. I think we should just check whether it's a resource item, and skip setting the attribute if it's not. Because we should not make assumptions that won't hold true. |
|
If you don't mind, maybe we could do this after #2797 is merged? I think it'll be easier. |
Hi @borNfreee, |
Hi @teohhanhui,
You know better, I guess ;) |
|
Wouldn't it be less restrictive to check if the E.g. when we dispatch a request for a DTO or any other unidentifiable resource and the DataPersister returns any other applicable ApiResource than given in // ... SNIP
if ($hasOutput) {
try {
$request->attributes->set('_api_write_item_iri', $this->iriConverter->getIriFromItem($controllerResult));
} catch (ResourceClassNotFoundException $e) {
// swallow
}
}Unfortunately the IriConverter bubbles only a simple |
|
Looks like this issue is related #2860 |
|
See #2860 (comment) I think this is not a bug. |
|
Replaced by #2910 |
Issue happens when
outputclass for a specific operation is not related to a class that represents api resource.WriteListenertries to set_api_write_item_irifrom a result object (defined inoutputattribute of an operation) but fails as it's not possible.