-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if a tag does not exist, we dont want the query to crash #61
Conversation
I'm currently working on a flarum implementation, and noticed the tags search would fail when a tag was entered that did not exist. this works: this does not work: this pull request will fix the query to return an empty result |
not sure why one test failed.. |
Because your conditional markup is incorrect, see: https://github.styleci.io/analyses/zdBJZv |
Strange, looks fine to me in the commit 6680e5a |
@tom-it it's missing the space between Also, indentation is wrong. I think StyleCI gives you the patch to make the necessary changes. |
Ah Thanks, will check it out! adding the == true is a personal preference, but I understand that the code needs to be uniform to prevent different styles from cluttering up the codebase. |
I was looking at this PR and - although solving it is absolutely a requirement - the approach is off. The problem here is that the repository method I'd like to propose the following solution and hoping you, @tom-it, would like to give this a shot:
Thanks for your first ever PR to this project! |
Sure thing, I will check it out tonight. I'm currently working on a flarum project so I will be doing some more PR's on the main flarum project as well, and see where I can help out on any open issues. |
That would be great Thomas and I love seeing another 🇳🇱around here ;) If you have any questions, we're on discord most of the time http://flarum.org/discord/ |
Revert "if a tag does not exist, we dont want the query to crash" This reverts commit 6680e5a.
I have added the functionality as described, still styleci doesn't like my commit, do I need to remove the new lines? |
Let me know if you need anything else for this. |
Looks good, thanks @tom-it. And the original issue is still fixed? |
@tobyzerner correct tested and working |
The original issue is also guaranteed to be fixed because of the return type hinting. A Collection instance would trigger an error. Great job Thomas! |
* if a tag does not exist, we dont want the query to crash * incorrect solution Revert "if a tag does not exist, we dont want the query to crash" This reverts commit 6680e5a. * repaired getIdForSlug function to return int or null * changed where, removed isempty not needed
* if a tag does not exist, we dont want the query to crash * incorrect solution Revert "if a tag does not exist, we dont want the query to crash" This reverts commit 6680e5a. * repaired getIdForSlug function to return int or null * changed where, removed isempty not needed
No description provided.