bmcclure/CakePHP-Media-Plugin — Issue #8: Deleting all versions of an image
Author: PHANTOMIAS
Created: 2012-02-01 13:25:50+00:00
State: open

I upload an image and generate automatically different versions.
Deleting a record which has an image, should also delete all versions of this image.

So I found this tutorial:
https://github.com/davidpersson/media/blob/next/docs/TUTORIAL

There is a function:
public function beforeDelete($cascade = true)

This one is called, but this line returns an error:
$versions = array_keys(Configure::read('Media.filter.' . $name));
This is caused by
Configure::read('Media.filter.' . $name)

$name is "image", so the call is
Configure::read('Media.filter.image')
and this returns NULL.

So the question is, why?
In my Plugin/Media/Config/core.php I did not change these lines, so it should work?

Configure::write('Media.filter', array('default' => array(
'audio' => compact('s', 'm'),
'document' => compact('s', 'm'),
'generic' => array(),
'image' => compact('s', 'm'),
'video' => compact('s', 'm')
)));

Is there a problem because of CakePHP 2.0?