Skip to content

Fixes #4521 #5857

Merged
merged 2 commits into from Apr 14, 2014

4 participants

@samsonasik

Fixes #4521

@mwillbanks

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

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 bug labels Apr 3, 2014
@weierophinney
Zend Framework 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.

@samsonasik

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

@weierophinney weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney weierophinney [#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.
2fb31ad
@weierophinney weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney weierophinney Merge branch 'hotfix/5857' into develop
Forward port #5857
672b84f
@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

Details continuous-integration/travis-ci The Travis CI build passed
@weierophinney weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney weierophinney Merge branch 'hotfix/5857'
close #5857
fixes #4521
653d804
@weierophinney
Zend Framework 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.

@samsonasik

@weierophinney thank you ;)

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zf2#5857 from samsonasik/validator-db 4d51c49
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zf2#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.
0882e33
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5857' de16713
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5857' into develop 63af384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.