Project

General

Profile

Actions

Bug #67972

closed

New custom viewhelpers only work after manually clearing typo3temp/ directory

Added by Klaus Fiedler over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-07-08
Due date:
% Done:

0%

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

Description

After an update to TYPO3 7.3 I created a new custom viewhelper for one of my extensions. There were other viewhelpers already and they were working fine.

When used, the new viewhelper threw the error "#1289386765: Could not analyse class:(...) maybe not loaded or no autoloader?" That error occured despite clearing all caches etc.

I had to clear the typo3temp/ directory manually for the new viewhelper to work.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #67996: Provide reasonable way to clear autoloader cachesClosed2015-07-09

Actions
Actions #1

Updated by Wouter Wolters over 9 years ago

  • Status changed from New to Closed

Please read the following This will describe what you should know and do when having this problem:

=============================================
Breaking: #67212 - Discard TYPO3 class loader =============================================

Description ===========

The former TYPO3 class loader has been removed in favor of the composer class loader.

Impact ======

ext_autoload.php files are not evaluated any more. Instead all class files are registered
automatically during extension installation and written into a class map file. This class map file is
not changed during regular requests, but only if the extension list changes (by using the Extension Manager).

These class information files are located in the :file:`typo3temp/autoload/` directory and will also be automatically
created if they do not exist.

Non-namespaced classes with ``Tx_`` naming convention like ``Tx_Extension_ClassName`` are only resolved through
the aforementioned class map, but not dynamically. This means that extension authors need to re-generate the class map
files when introducing new classes. Thus it is highly recommended to use a Classes folder with PSR-4 standard class
files in there.

When installing TYPO3 with composer, it also means that all extensions need to bring their own :file:`composer.json`
file with class loading information or the class loading information of all extensions need to be specified in the root
:file:`composer.json` for class loading to work properly.

Affected Installations ======================

All installations are affected.

Migration =========

No migration is needed during upgrade if TYPO3 is installed in the classic way.
If TYPO3 is installed in a distribution via composer, missing class loading information need to be provided in root
composer.json for all extensions which do not bring their own composer.json manifest.

.. code-block:: json

{
"autoload": {
"psr-4": {
"GeorgRinger\\News\\": "typo3conf/ext/news/Classes/",
"MyAwesomeNamespace\\IncrediExt\\": "typo3conf/ext/incredible_extension/Resources/PHP/Libraries/lib/"
}
}
}
Actions #2

Updated by Helmut Hummel over 9 years ago

What should have been added to the documentation (will push a followup) is that if an extension provides a composer.json with a psr-4 section, classes can be added dynamically without updating the class loading information. Will take care to do so

Actions

Also available in: Atom PDF