Project

General

Profile

Actions

Bug #100124

closed

CObjectViewHelper throws warnings caused by uncatched optional arguments

Added by Timo Pfeffer about 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Fluid
Start date:
2023-03-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
ViewHelpers
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The registered arguments "currentValueKey" and "table" of CObjectViewHelper are defined as optional, but the code inside renderStatic does not check if these two arguments are existing. Instead it just uses these two args, which causes warnings inside log module.

Actions #1

Updated by Thomas Hohn about 1 year ago

  • Category set to Fluid
  • Assignee set to Thomas Hohn
Actions #2

Updated by Thomas Hohn about 1 year ago

@Timo Pfeffer - Can you provide info on how to reproduce the error?

Actions #3

Updated by Timo Pfeffer about 1 year ago

Steps to reproduce:

1) Configure $GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandlerErrors'] to handle warnings too
2) use f:cObject inside Fluid template without defining the described attributes
3) call "the template" in browser and look into the log module

expected behaviour:
two new entries inside log module for each of the missing attributes.

Actions #4

Updated by Thomas Hohn about 1 year ago

Hi - tried with

page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
    template = TEXT
    template.value = <f:cObject typoscriptObjectPath="lib.test" data="foo"/>
}
lib.test = TEXT
lib.test.current = 1

And
[SYS][errorHandlerErrors] = 30466

Doesnt trigger it at my site

Actions #5

Updated by Timo Pfeffer about 1 year ago

Hmm the page of us is full of these warnings.
Is it ensured that optional arguments are filled in $arguments too, although these are not defined in fluid?

Actions #6

Updated by Thomas Hohn about 1 year ago

Hi @Timo Pfeffer

My output looks like:

/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php:139:
array (size=4)
  'data' => string 'foo' (length=3)
  'typoscriptObjectPath' => string 'lib.test' (length=8)
  'currentValueKey' => null
  'table' => string '' (length=0)

With the following TS config:
lib.test = TEXT
lib.test.current = 1

Actions #7

Updated by Timo Pfeffer about 1 year ago

Okay then it must be a problem with the current website implementation. I will check it. Perhaps it has been something in common with the temporary fix of another forge ticket of mine, but not sure.
Please leave it open, i will check it in the next hours/days.

Actions #8

Updated by Georg Ringer 12 months ago

  • Status changed from New to Needs Feedback

did you have time to take a look in your setup?

Actions #9

Updated by Timo Pfeffer 12 months ago

yes I have checked it and have solved it, but forget to write it down here. Sadly i don't know anymore what exactly fixed this behaviour. So you can close this ticket.

Actions #10

Updated by Simon Praetorius 11 months ago

  • Status changed from Needs Feedback to Resolved
Actions

Also available in: Atom PDF