mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/5715
State: closed
Merged: No
PR #507 (issue #2815 [DDC-2128]) introduced a regression, with the effect that when providing a filter array with more than one string, only the first pattern is tested (and the subsequent ones are like ignored).
With the series of commits
6963bf6028%5E...9a3cf77919b0541048be5bfe7806a001c31974d1, the functionaccept()was modified so that, if the first pattern of the$this->filterarray (is not invalid, but) does not match$metadata->name, then the function returnsfalseearly, never trying the next patterns in the array.Instead, it should continue to iterate, and only return
trueon the first encountered pattern that matches (if any) or returnfalseafter the end of the loop (if no pattern matched). (That's what it was doing before the series of commits, see6963bf6028%5E/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php#L78-L84.)Sorry I cannot practically write a unit-test for this fix, but feel free to add one (or help me).Update: I added a test (and checked that it was passing before the regression, is failing without the fix and is passing with the fix).
Update (2): I amended the test commits (sorry for the confusion if any). The fix is only for version 2.5+ but the test could be suitable for 2.4 (and maybe even older branches) by not taking the last commit.