dereuromark / cakephp-hashid

CakePHP plugin to use hashids for your database table lookups
MIT License
36 stars 13 forks source link

Fixed a bug where the formatResults function in the findHashed method was wiping out the resultset. #16

Closed joshrhykerd closed 6 years ago

joshrhykerd commented 6 years ago

I added a catchall condition that keeps newResult from becoming empty.

I ran into this issue on my own, but I believe it is a fix for https://github.com/dereuromark/cakephp-hashid/issues/11 and possibly also https://github.com/dereuromark/cakephp-hashid/issues/13

dereuromark commented 6 years ago

Can we maybe have a Test case to make sure this doesnt happen again? Thx for looking into this.

dereuromark commented 6 years ago

Thanks a lot!

joshrhykerd commented 6 years ago

No problem!

dereuromark commented 6 years ago

Do you happen to know anything about the open PR for exists() and if it solves it?

joshrhykerd commented 6 years ago

Based on this comment https://github.com/dereuromark/cakephp-hashid/issues/13#issuecomment-299849966 I would tend to think it would solve it as this was the issue with IsUniuque, but I can invenstigate it further if you'd like to be certain.

dereuromark commented 6 years ago

That would be awesome! Then I can patch-release both fixes together.

joshrhykerd commented 6 years ago

It seems that this fix does also resolve https://github.com/dereuromark/cakephp-hashid/issues/13 as we thougth it might. I provided a new test case to prove this.

dereuromark commented 6 years ago

Yeah thats what I also thought, thanks for confirming it, I just released.