Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataProcessor returning empty array if no "as" conf value found in typoscript #122

Open
ironeddie opened this issue Jun 26, 2020 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@ironeddie
Copy link

Hi guys, i am struggling with dataProcessors in custom content elements and headless…
assuming a content element dataProcessing like following:

tt_content.borderelement.dataProcessing {
    1001 = Border\SitePackage\Processor\ContentElementsProcessor
}

and finding in extension code
FriendsOfTYPO3\Headless\ContentObject\JsonContentObject
on line 205-210 the code is searching for a “as” definition in conf, otherwise it will return an empty array… this is perhaps not the right behaviour as the data processor for the content element itself will fill the data array to my proper needs. is this a bug? (bearbeitet)

@lukaszuznanski
Copy link
Collaborator

it's intented because we need to know which key in data from dataProcessors we should display, I would like to set some default fallback, but current implementation of dataProcessors is inconsistent, as there is no standardization in terms of default "as" value along dataProcessors, so we need to set "as" in dataProcessor. On upcoming codesprint I would like to take care of this issue.

@ironeddie
Copy link
Author

as i changed line 211 in JsonContentObject.php
from
return $dataProcessingData;
to
return (empty($dataProcessingData) ? $data : $dataProcessingData);

all my data is now rendered properly in the returning result from request. Maybe this is already a workaround and a possible solution for this issue...

please let me know if you think this may lead to unpredictable behaviour on other side.
thank you.

@lukaszuznanski
Copy link
Collaborator

Hi,

I guess, your solution renders all data that comes from dataProcessor if you don't specify 'as'?

It's ok, as if you don't set 'as' then you have whole output. Could you provide PR with this change?

@tmotyl tmotyl added this to TODO in Headless & PWA sprint Jul 1, 2020
@lukaszuznanski lukaszuznanski added bug Something isn't working good first issue Good for newcomers labels Jul 3, 2020
@lukaszuznanski
Copy link
Collaborator

@gordon81 taking the issue

@lukaszuznanski lukaszuznanski moved this from TODO to in progress in Headless & PWA sprint Jul 9, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 9, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 9, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 9, 2020
@lukaszuznanski lukaszuznanski moved this from in progress to Missing review in Headless & PWA sprint Jul 10, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 10, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 10, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 10, 2020
gordon81 pushed a commit to gordon81/headless that referenced this issue Jul 10, 2020
@lukaszuznanski lukaszuznanski added this to the 3.0.0 milestone Oct 15, 2021
@lukaszuznanski lukaszuznanski added this to To do in TYPO3 Headless & PWA Codesprint via automation Oct 15, 2021
@lukaszuznanski lukaszuznanski removed this from Missing review in Headless & PWA sprint Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants