Project

General

Profile

Actions

Bug #56993

closed

Cached classloader fails with fluid and is_callable()

Added by Christian Weiske about 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2014-03-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The new cached classloader tells you

#1233057566: "12:47" is not a valid cache entry identifier.

when is_callable() is used with a string that is not a proper class name.

Extbase/Fluid tries to determine if a fluid property path can be called with is_callable(). During path processing, it may call is_callable() with a string that is not a normal class name.

Steps to reproduce:

1. Extbase controller:

$this->view->assign('foo', '1:2');

2. Fluid template:

<if condition="{foo.bar}"></if>

This happens with TYPO3 6.2beta7.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #56797: Cleanup ClassLoaderClosedMarkus Klein2014-03-11

Actions
Actions #1

Updated by Christian Weiske about 10 years ago

The "Cleanup ClassLoader" task #56797 removed a try/catch-Block which caught this exception previously.

Actions #2

Updated by Gerrit Code Review about 10 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/28467

Actions #3

Updated by Helmut Hummel about 10 years ago

  • Status changed from Under Review to Needs Feedback

Christian Weiske wrote:

when is_callable() is used with a string that is not a proper class name.

can you please provide the class and line where these checks are performed?

Extbase/Fluid tries to determine if a fluid property path can be called with is_callable(). During path processing, it may call is_callable() with a string that is not a normal class name.

Steps to reproduce:

1. Extbase controller:

$this->view->assign('foo', '1:2');

2. Fluid template:

<if condition="{foo.bar}"></if>

could not trigger this with this code (class loader is not triggered with class name "1:2")

Actions #4

Updated by Helmut Hummel about 10 years ago

Helmut Hummel wrote:

Christian Weiske wrote:

Steps to reproduce:

1. Extbase controller:

$this->view->assign('foo', '1:2');

2. Fluid template:

<if condition="{foo.bar}"></if>

could not trigger this with this code (class loader is not triggered with class name "1:2")

Ah, OK, could reproduce it now.
Can you provide a real use case where this can happen?

$this->view->assign('foo', '1:2'); and then <if condition="{foo.bar}"></if> is not nice to fatal there (which is fixed now btw), but it also does not look like it makes much sense to do things like that ;)

Anyway, if we can avoid triggering the class loader in Fluid, we should do so. For that we need to understand the use case and how we then can deal with that in Fluid

Actions #5

Updated by Christian Weiske about 10 years ago

We have some partials that used to render generic data elements.

For example:

$data[] = (object)array('value' => 12.5, 'unit' => 'C');
$data[] = '12:05';

Those data are aggregated from different APIs.

Now our partial contains the following code to determine if it is a unit/value datum or not:

<if condition="{datum.value}">
 <then>{datum.value} {datum.unit}</then>
 <else>{datum}</else>
</if>

I think this is a sensible use case.

Actions #6

Updated by Gerrit Code Review about 10 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/28586

Actions #7

Updated by Helmut Hummel about 10 years ago

Christian Weiske wrote:

We have some partials that used to render generic data elements.

Those data are aggregated from different APIs.
Now our partial contains the following code to determine if it is a unit/value datum or not:

Thanks.

I think this is a sensible use case.

Absolutely! I pushed a patchset to prevent the lookup if the subject is a scalar (neither array nor object)

Actions #8

Updated by Helmut Hummel about 10 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF