Monthly Archives: January 2015

Remember the bloody Cache!

The Situation:

You change annotations in your classes (e.g. the @validate annotations for your controller or for your entity objects). Of course you implemented some test cases before to check, if the validator is used and does it’s work. But… The bloody validator is not called, the annotation has exactly NO effect.

The Reason:

Typo3 caches the class information (incl. the annotations) internally in order to not parse all the class structures on each and every request (i.e. to save time…). As long as this cache is not refreshed, your annotation changes will have no effect at all.

The Solution:

Bildschirmfoto vom 2015-01-10 21:23:26

  1. You can uninstall and re-install your extension on each and every development step. This is pretty annoying, but cleares the cache reliably.
  2. If you just overwrite your php-files inside the Typo3 ext folder (see also I am lazy (The Server Architecture)), you have to clear the cache manually at least when changing class information like annotations.

The Problem:

You don’t have to do this very often, because most of the time you just change the internal implementation and not the class structure. Thus you don’t think of clearing the cache and just skip this step. This blog post is just here to remember you on that topic. Whenever something is not working at all, try to clear the cache and retest first. This might solver your problem immediatly.