Project

General

Profile

Actions

Bug #93513

closed

Bug: TypoScript: TypeError if .postUserFunc= without .postUserFunc.xxx=

Added by Martin Bless about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2021-02-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Problem

Code

# good, works
lib.helloworld_1 = TEXT
lib.helloworld_1 {
  value = Hello world!
}

# bad, FAILS
lib.helloworld_2 = TEXT
lib.helloworld_2 {
  value = Hello world!
  postUserFunc = ArtbeitDesign\Sitepackage\Utility\HttpCookie->csvAddRegionCookie
}

# good, works
lib.helloworld_3 = TEXT
lib.helloworld_3 {
  value = Hello world!
  postUserFunc = ArtbeitDesign\Sitepackage\Utility\HttpCookie->csvAddRegionCookie
  postUserFunc {
  }
}


Files

389.png (68.1 KB) 389.png Martin Bless, 2021-02-15 08:27

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93758: postUserFunc type issuesRejected2021-03-17

Actions
Actions #1

Updated by Georg Ringer about 3 years ago

  • Status changed from New to Accepted
Actions #2

Updated by Georg Ringer about 3 years ago

  • Status changed from Accepted to Needs Feedback

what about just doing

public function fo(string $content, array $conf = null)  {

}

and it will work just fine

Actions #3

Updated by Martin Bless about 3 years ago

Georg Ringer wrote in #note-2:

what about just doing

[allow null]

and it will work just fine

I mainly wanted to point out a problem that you can run into if you follow the documentation.
The question is:

  • Is allowing for null best practice? Then we should update documentation.
  • Should null not be expected? Then the callers should be fixed.

How to decide?

Actions #4

Updated by Gerrit Code Review about 3 years ago

  • Status changed from Needs Feedback 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/+/68168

Actions #5

Updated by Gerrit Code Review about 3 years ago

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

Actions #6

Updated by Georg Ringer about 3 years ago

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

Updated by Martin Bless about 3 years ago

Great, thank you everybody involved!

Actions #8

Updated by Georg Ringer about 3 years ago

  • Related to Bug #93758: postUserFunc type issues added
Actions #9

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF