Got problems switching from 0.7.0 to latest version ?

Error: cannot instanciate class

Problem

You installed latest version, and your FE-plugins stopped working as they did with 0.7.0.

This PHP error shows up:

 

Fatal error: Cannot instantiate non-existent class: tx_ameosformidable in /mywebsite/typo3_src-4.1.2/t3lib/class.t3lib_div.php on line 4027

Solution

Simply add at the top of your php-plugin class:

 

require_once(PATH_formidableapi);

Explanation

In 0.7.0 and prior versions, Formidable was automatically required at each page display, and thus there was no need to include it by yourself in your plugins.

 

With latest version, this has changed, and now requiring the API is mandatory. To make things easier, we added the constant PATH_formidableapi that you just have to require at the top of your plugin.

Error: Failed opening required 'PATH_formidableapi/class.mainobject.php'

This php error shows up:

 

PHP Fatal error: require_once() [function.require]: Failed opening required 'PATH_formidableapi/class.mainobject.php' in /home/httpd/typo3conf/ext/ameos_formidable/api/class.tx_ameosformidable.php on line 43

Solution

Clear localconf cache files in /typo3conf

Explanation

ext_localconf.php has changed between 0.7.0 and 1.0.0, and thus, Formidable 1.0.0 won't work properly unless you clear the localconf cache.