[DoctrineBridge] deprecate MergeDoctrineCollectionListener::onBind()#18069
Conversation
HeahDude
commented
Mar 9, 2016
| Q | A |
|---|---|
| Branch | master |
| Bug fix? | no |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | yes |
| Tests pass? | yes |
| Fixed tickets | n/a |
| License | MIT |
| Doc PR | - |
|
But this is a BC break, isn't it? The listener will not execute the <?php
class MyMergeDoctrineCollectionListener extends MergeDoctrineCollectionListener
{
public function onBind()
{
// my own implementation
}
} |
|
@dosten Indeed. Have to keep the old method in the |
28dbfe4 to
2819bfd
Compare
|
Ok now 37cdb80 fixes the BC break and adds some tests. |
2819bfd to
37cdb80
Compare
37cdb80 to
6eb3873
Compare
|
What's the status of this one ? |
| public function onSubmit(FormEvent $event) | ||
| { | ||
| // If onBind() is overridden then logic has been executed | ||
| if ($this->bc) { |
There was a problem hiding this comment.
Not sure if that is sufficient. Someone who overrode the onBind() method will likely also have added a call to parent::onBind().
There was a problem hiding this comment.
Nice catch! Thanks, now fixed by https://github.com/symfony/symfony/pull/18069/files#diff-0bab777c646233bc954aa7792bc59d30R73
6eb3873 to
2e4fdfe
Compare
| */ | ||
| public function onBind() | ||
| { | ||
| if (self::class === __CLASS__) { |
There was a problem hiding this comment.
this will always be true, as self::class does not use late static binding
There was a problem hiding this comment.
I could use get_class($this) then.
2e4fdfe to
08a7a09
Compare
|
@stof Fixed, thanks. |
|
ping :) |
| * added "{{ value }}" message placeholder to UniqueEntityValidator | ||
| * added "{{ value }}" message placeholder to UniqueEntityValidator | ||
| * deprecated `MergeDoctrineCollectionListener::onBind` in favor of | ||
| `MergeDoctrineListener::onSubmit` |
There was a problem hiding this comment.
Shouldn't it be MergeDoctrineCollectionListener::onSubmit?
|
Apart from the typo, 👍 |
08a7a09 to
ad08b95
Compare
|
Fixed! Thanks. |
|
Thank you @HeahDude. |
…tener::onBind()` (HeahDude) This PR was merged into the 3.1-dev branch. Discussion ---------- [DoctrineBridge] deprecate `MergeDoctrineCollectionListener::onBind()` | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | - Commits ------- ad08b95 [DoctrineBridge] deprecated `MergeDoctrineCollectionListener::onBind()`
This PR was merged into the 3.1-dev branch. Discussion ---------- [DoctrineBridge] Fixed bc layer after #18069 | Q | A | ------------- | --- | Branch? | master | Bug fix? | BC break | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Commits ------- 8a6cf9d [DoctrineBridge] fixed bc layer from #18069