Fixes #4521 #5857

Merged
merged 2 commits into from Apr 14, 2014

Conversation

Projects
None yet
4 participants
@samsonasik
Contributor

samsonasik commented Feb 23, 2014

Fixes #4521

@mwillbanks

This comment has been minimized.

Show comment
Hide comment
@mwillbanks

mwillbanks Mar 3, 2014

Contributor

This could potentially have negative side effects. Generally the select instance becomes cached and this removes it which if you build out a select and then call getSelect it may rebuild the select again. Maybe it should be resolved by instantiating the object?

Contributor

mwillbanks commented Mar 3, 2014

This could potentially have negative side effects. Generally the select instance becomes cached and this removes it which if you build out a select and then call getSelect it may rebuild the select again. Maybe it should be resolved by instantiating the object?

@samsonasik

This comment has been minimized.

Show comment
Hide comment
@samsonasik

samsonasik Mar 3, 2014

Contributor

what you mean by instantiating the object ? the issue is when same object re-populate the options data with other option. what your suggestion ?

Contributor

samsonasik commented Mar 3, 2014

what you mean by instantiating the object ? the issue is when same object re-populate the options data with other option. what your suggestion ?

@Ocramius Ocramius added Db labels Apr 3, 2014

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Apr 11, 2014

Member

@samsonasik I'd argue that the better approach is to reset the $select property when any of the $table, $schema, $field, or $exclude properties change. This way the Select object can be cached and only rebuilt when necessary.

Member

weierophinney commented Apr 11, 2014

@samsonasik I'd argue that the better approach is to reset the $select property when any of the $table, $schema, $field, or $exclude properties change. This way the Select object can be cached and only rebuilt when necessary.

@samsonasik

This comment has been minimized.

Show comment
Hide comment
@samsonasik

samsonasik Apr 11, 2014

Contributor

@weierophinney done ;). Added condition to reset $select only if $table, $schema, $field, or $exclude properties changed.

Contributor

samsonasik commented Apr 11, 2014

@weierophinney done ;). Added condition to reset $select only if $table, $schema, $field, or $exclude properties changed.

weierophinney added a commit that referenced this pull request Apr 14, 2014

weierophinney added a commit that referenced this pull request Apr 14, 2014

[#5857] Better logic for resetting select
- Reset the select object whenever any of the various setters are called that
  could modify the behavior of the select.

weierophinney added a commit that referenced this pull request Apr 14, 2014

@weierophinney weierophinney added this to the 2.3.1 milestone Apr 14, 2014

@weierophinney weierophinney merged commit 32d6030 into zendframework:master Apr 14, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

weierophinney added a commit that referenced this pull request Apr 14, 2014

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Apr 14, 2014

Member

Wasn't quite what I was getting at, @samsonasik - but I updated it to do it properly. Essentially, whenever any of the setters are called for table, schema, field, or exclude, the $select property should be nulled, which will force getSelect() to rebuild it on next invocation.

Member

weierophinney commented Apr 14, 2014

Wasn't quite what I was getting at, @samsonasik - but I updated it to do it properly. Essentially, whenever any of the setters are called for table, schema, field, or exclude, the $select property should be nulled, which will force getSelect() to rebuild it on next invocation.

@samsonasik

This comment has been minimized.

Show comment
Hide comment
@samsonasik

samsonasik Apr 14, 2014

Contributor

@weierophinney thank you ;)

Contributor

samsonasik commented Apr 14, 2014

@weierophinney thank you ;)

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

[zendframework/zendframework#5857] Better logic for resetting select
- Reset the select object whenever any of the various setters are called that
  could modify the behavior of the select.

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment