Project

General

Profile

Actions

Bug #91382

closed

Ajax Widgets with QueryResult Object as Argument throw an Error since 9.5.17

Added by Jonas Götze over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2020-05-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

When using a fluid ajax widget (custom or from core, e.g. autocomplete widget) which stores its configuration in the session you get an Exception:

#1588178538 TYPO3\CMS\Fluid\Core\Widget\Exception

Widget configuration items either must be null, scalar, array or JSON serializable, got "TYPO3\CMS\Extbase\Persistence\Generic\QueryResult"

<input type="text" id="myautocomplete" name="myautocomplete" />
<f:widget.autocomplete objects="{news}" for="myautocomplete" searchProperty="title" />

This is because the security related change here https://github.com/TYPO3/TYPO3.CMS/commit/e4fb92a85bed8067d45d2c25c4b559642f206248 which does not accept such an object as it is not JsonSerializable.
Though I am unsure about where and how this should be fixed.


Files

var_dump.html (36.3 KB) var_dump.html Jonas Götze, 2020-05-14 14:58
composer.json (1.29 KB) composer.json Jonas Götze, 2020-05-14 15:00
typo3_52c8fd3ac4.log (24.6 KB) typo3_52c8fd3ac4.log Jonas Götze, 2020-05-14 15:07

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #91418: UnknownClassException with Fluid autocomplete widgetClosed2020-05-16

Actions
Actions #1

Updated by Jonas Götze over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Oliver Hader over 4 years ago

  • Status changed from New to Needs Feedback

Can you please post a stack trace and if possible a dump of the objects to be JSON encoded as well - probably before the mentioned exception is thrown in https://github.com/TYPO3/TYPO3.CMS/commit/e4fb92a85bed8067d45d2c25c4b559642f206248#diff-680bd81bb107cde8de9cacd799385680R133

Thx

Actions #4

Updated by Oliver Hader over 4 years ago

  • Is Regression set to Yes
Actions #5

Updated by Oliver Hader over 4 years ago

  • Target version set to 9.5.18 & 10.4.3

Updated by Jonas Götze over 4 years ago

Thanks for looking into this.

I just created a new ddev with blank TYPO3 10 and ext:news (just as example - it is not related to news!).
Then edited the news list template and added the html from above. In the backend I created 3 simple news records, included Typoscript and added the list plugin to a site.

Please find the Stack trace from TYPO3 Log attached, also the output from f:debug of {news} and my composer.json.

Actions #7

Updated by Jonas Götze over 4 years ago

  • Priority changed from Must have to Should have
  • Target version set to 9.5.18 & 10.4.3

sorry - these changes were not intended.

Actions #8

Updated by Oliver Hader over 4 years ago

  • Status changed from Needs Feedback to Accepted

Okay, so we have

  • TYPO3\CMS\Extbase\Persistence\Generic\QueryResult having GeorgRinger\News\Domain\Model\News items
  • and this QueryResult object in the widget-context
Oops, an error occurred! Code: 202005141250595edad60f - {
"exception":"TYPO3\\CMS\\Fluid\\Core\\Widget\\Exception: Widget configuration items either must be null, scalar,
array or JSON serializable, got \"TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult\" in
/var/www/html/public/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php:141

Stack trace:
#0 [internal function]: TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext->TYPO3\\CMS\\Fluid\\Core\\Widget\\{closure}(Object(TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult))
#1 /var/www/html/public/typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php(148): array_filter(Array, Object(Closure))
#2 [internal function]: TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext->jsonSerialize()

As a consequence QueryResult should be JsonSerializable as well in order to fix this issue.

Actions #9

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #10

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #11

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #12

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64503

Actions #13

Updated by Gerrit Code Review over 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #14

Updated by Oliver Hader over 4 years ago

  • Related to Bug #91418: UnknownClassException with Fluid autocomplete widget added
Actions #15

Updated by Gerrit Code Review over 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #16

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64503

Actions #17

Updated by Gerrit Code Review over 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64501

Actions #18

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64503

Actions #19

Updated by Oliver Hader over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #20

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF