Forums / Developer / content edit handler has to have the same name as extension

content edit handler has to have the same name as extension

Author Message

Marko Žmak

Wednesday 29 June 2011 3:45:27 pm

By looking at the code that loads content edit handlers from extensions I see this line:

$fileName = eZExtension::baseDirectory() . '/' . $extensionDirectory . '/content/' . $extensionDirectory . 'handler.php';

This means that the name of the file containing content edit hanlder has to be in this form:

<extension_name>handler.php

And by looking furthermore, I see that the name of the handler class has to be in form:

<extension_name>Handler

Why is this restriction in efect? Is there a good reason fo it? Shouldn't things like this be configurable?

Because this means that you can have only one content edit handler per extension.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

André R.

Thursday 30 June 2011 12:46:56 am

To be able to get rid of this it will need to switch the handler setting to one that is a list of class names instead of extension names, hence use autoloader instead of the 3.x way of loading handlers.

Basically similar to how we changed lots of handlers in 4.1 to use autoload, feel free to create a pull request for it but remember: Do not re use same setting name, extensions should be able to support old and new eZ Publish versions. And remember to add bc note about it.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom