Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Change to InputFilterFactory and CollectionInputFilter to support nested input-filter config #7554

Closed
wants to merge 4 commits into from
Closed

Conversation

nobesnickr
Copy link

I've had some difficulty implementing InputFilterFactory via array config when needing to implement nested CollectionInputFilter; Specifically when using zf-content-validation.

My use case is such that input will have nested entities (and associated input filter configurations), and my problems arose from having to explicitly re-define/duplicate the validators because the base InputFilterPluginManager was not available downstream.

I'm suggesting the following changes that I've made to resolve this:

  1. Added the InputFilterPluginManager to new InputFilterFactory instances created via the Input Filter Abstract Service Factory.
  2. Added functionality to retrieve nested InputFilters on the CollectionInputFilter via the Service Manager if available (allowing for nested InputFilter configurations).

I encourage feedback and will be happy to re-work as needed as there may be a reason the InputFilterManager wasn't supplied in the factory initially.

…s created via the Abstract Service Factory.

Added functionality to retrieve nested InputFilters on the CollectionInputFilter via the Service Manager if available (allowing for nested InputFilter configurations).
@gianarb
Copy link
Contributor

gianarb commented May 28, 2015

Hi! can you pull this feature in your repository please?
https://github.com/zendframework/zend-inputfilter

@Martin-P
Copy link
Contributor

Please fix the travis errors, your fix seems to break things. Also unittests are missing.

…ilterManager and ValidatorManager. Added Unit Testing assets and test to cover fix
@@ -17,7 +17,7 @@
/**
* Plugin manager implementation for input filters.
*
* @method InputFilterInterface|InputInterface get($name)
* @method InputFilterInterface|InputInterface get( $name )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use PSR-2 coding style. No spaces here.

@Maks3w Maks3w closed this May 29, 2015
@Maks3w Maks3w reopened this May 29, 2015
@zendframework zendframework locked and limited conversation to collaborators May 29, 2015
@zendframework zendframework unlocked this conversation May 29, 2015
@nobesnickr
Copy link
Author

This might seem silly but can someone help me in diagnosing why the build is failing in 5.6? I'm not seeing any errors and 5.3-5.5 are passing just fine?

@Maks3w
Copy link
Member

Maks3w commented May 29, 2015

@nobesnickr Please migrate your PR against the zend-inputfilter repo

@nobesnickr
Copy link
Author

Ok I've created the PR against the zend-inputfilter repo (zendframework/zend-inputfilter#3). Let me know if anything else is needed

@gianarb
Copy link
Contributor

gianarb commented May 30, 2015

Thanks this PR is ready to close :)

@Maks3w Maks3w closed this May 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants