Bug #78270

\TYPO3\CMS\Extbase\Reflection\ObjectAccess::getGettablePropertyNames returns wrong property names

Added by Nicole Cordes over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
-
Start date:
2016-10-12
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Requirements to reproduce:

1) Fluid template with f:cObject and an object as data usage
<f:cObject typoscriptObjectPath="lib.someLibObject" data="{object}" />

2) Object has an property which is annotated as DateTimeZone object

Expected result:
The object should be converted into an array typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php:135

Actual result:
A warning is triggered because DateTimeZone::getOffset needs a parameter

Currently Extbase slightly require a getter method without any parameter. But it can happen that on some objects even the "magic" methods have parameter.


Related issues

Related to Page Teaser (with Fluid) - Bug #79338: PHP warning on "getCustomAttribute" call in model Page New 2017-01-16
Related to SB Portfolio 2 - Bug #61158: Error on Item Single View Resolved 2014-08-22

Associated revisions

Revision 7adb722a (diff)
Added by Nicole Cordes about 3 years ago

[BUGFIX] Use reflection information in getGettablePropertyNames

In \TYPO3\CMS\Extbase\Reflection\ObjectAccess there is a method to get
all available property names of an object. Currently all get/is/has
methods are joined as they can be fetch from Extbase as well. But for
those methods it is necessary to respect their arguments as Extbase
calls those functions without any argument. This can trigger PHP warnings.

The patch uses a class reflection to get public properties and inspect
the method arguments. Only those functions without arguments or only
optional arguments are considered as valid property name.

Resolves: #78270
Releases: master, 7.6
Change-Id: Ie286dca2a249b73d3dc58f7388dda593a678db3d
Reviewed-on: https://review.typo3.org/50197
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Philipp Gampe <>
Tested-by: Philipp Gampe <>

Revision 7efc0924 (diff)
Added by Nicole Cordes about 3 years ago

[BUGFIX] Use reflection information in getGettablePropertyNames

In \TYPO3\CMS\Extbase\Reflection\ObjectAccess there is a method to get
all available property names of an object. Currently all get/is/has
methods are joined as they can be fetch from Extbase as well. But for
those methods it is necessary to respect their arguments as Extbase
calls those functions without any argument.
This can trigger PHP warnings.

The patch uses a class reflection to get public properties and inspect
the method arguments. Only those functions without arguments or only
optional arguments are considered as valid property name.

Resolves: #78270
Releases: master, 7.6
Change-Id: Ie286dca2a249b73d3dc58f7388dda593a678db3d
Reviewed-on: https://review.typo3.org/51361
Tested-by: TYPO3com <>
Reviewed-by: Philipp Gampe <>
Tested-by: Philipp Gampe <>

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New 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/50197

#2 Updated by Gerrit Code Review over 3 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/50197

#3 Updated by Gerrit Code Review over 3 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/50197

#4 Updated by Gerrit Code Review over 3 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/50197

#5 Updated by Nicole Cordes over 3 years ago

  • Description updated (diff)

#6 Updated by Gerrit Code Review over 3 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/50197

#7 Updated by Gerrit Code Review over 3 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/50197

#8 Updated by Nicole Cordes about 3 years ago

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

#9 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51361

#10 Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51361

#11 Updated by Nicole Cordes about 3 years ago

  • Status changed from Under Review to Resolved

#12 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

#13 Updated by Christian Weiske 7 months ago

  • Related to Bug #79338: PHP warning on "getCustomAttribute" call in model Page added

#14 Updated by Christian Weiske 7 months ago

  • Related to Bug #61158: Error on Item Single View added

Also available in: Atom PDF