Skip to content
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

PHP7.2 count fixes #5427

Merged
merged 2 commits into from
Apr 29, 2018
Merged

PHP7.2 count fixes #5427

merged 2 commits into from
Apr 29, 2018

Conversation

snipe
Copy link
Owner

@snipe snipe commented Apr 25, 2018

This should fix some of the count errors we're running into when the object being counted is null. I've re-enabled travis tests for 7.2 for now so we can track down places I missed.

@dmeltzer @uberbrady if either/both of you could eyeball this, seeing as it's 3:22AM, I might have donked something up :)

@snipe snipe requested a review from uberbrady as a code owner April 25, 2018 10:22
@snipe
Copy link
Owner Author

snipe commented Apr 25, 2018

This is still failing on travis for 7.2, but for the same weird updated_at reasons that it usually fails for.

I'm not really sure why we're getting a off-by-one-second Carbon parse, TBH... It doesn't really make sense.

@dmeltzer
Copy link
Contributor

Looks good to me. I wonder if any of these placed would benefit from a withCount()/counting on the db side instead of ->count on the fetched collection? Not sure if theres a performance difference.

@snipe snipe merged commit 71708e3 into develop Apr 29, 2018
@snipe
Copy link
Owner Author

snipe commented May 23, 2018

Testing linking back from discourse. Ignore this :)
http://discourse.snipeitapp.com/t/this-is-a-test-post-in-bug-reports/17/2


$total = count($fields);
return (new CustomFieldsTransformer)->transformCustomFields($fields, $total);
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing linking back from discourse via commit comment. Ignore this :)
http://discourse.snipeitapp.com/t/this-is-a-test-post-in-bug-reports/17/2

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snipe
Copy link
Owner Author

snipe commented May 23, 2018

This pull request has been mentioned on Snipe-IT Discussion. There might be relevant details there:

http://discourse.snipeitapp.com/t/testing-the-gh-linkback-plugin/28/1

@snipe snipe deleted the features/php7.2-count-fixes branch May 23, 2018 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants