Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix hook in plugin manager #3219

wants to merge 2 commits into from

2 participants


This fix is needed in order for the new approach to create elements to work. Basically, the init function was called correctly when creating element through factory, but was not otherwise (for instance, when you simply pull an invokable form from service manager).

Maybe this could be moved in AbstractPluginManager for every class that implements InitializableInterface.

@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3219' into develop
Close #3219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 13, 2012
  1. @bakura10

    Fix hook in plugin manager

    bakura10 committed
  2. @bakura10
This page is out of date. Refresh to see the latest.
6 library/Zend/Form/Factory.php
@@ -16,7 +16,6 @@
use Zend\InputFilter\InputFilterInterface;
use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\Hydrator;
-use Zend\Stdlib\InitializableInterface;
* @category Zend
@@ -217,11 +216,6 @@ public function configureElement(ElementInterface $element, $spec)
- // Hook to perform stuff, once all the configuration work has been done
- if ($element instanceof InitializableInterface) {
- $element->init();
- }
return $element;
6 library/Zend/Form/FormElementManager.php
@@ -12,6 +12,7 @@
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\ConfigInterface;
+use Zend\Stdlib\InitializableInterface;
* Plugin manager implementation for form elements.
@@ -102,6 +103,11 @@ public function injectFactory($element)
public function validatePlugin($plugin)
+ // Hook to perform various initialization, when the element is not created through the factory
+ if ($plugin instanceof InitializableInterface) {
+ $plugin->init();
+ }
if ($plugin instanceof ElementInterface) {
return; // we're okay
Something went wrong with that request. Please try again.