-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-21148 - Refactor two near-identical date functions into one #11887
Conversation
@eileenmcnaughton I've reviewed this, and unfortunately this approach won't work.
There's a difference between these two invocations:
In the first case, We discussed this some on the other PR, but the old
We either need to a) add that into Note that this is a separate issue from converting Anyway, you can replicate the bug I found by running the Activity Summary report with an Activity Date filter set to "today", then consulting the Developer tab. With
With this PR, it's:
|
@MegaphoneJon how about now - I re-instated the oddity in that function & soft deprecated the function (I figure it makes more sense to update the calls to bypass that function when we touch them). |
@eileenmcnaughton I've just retested this and feel good about this new cut. The test failure seems unrelated, so I'll give this a merge-on-pass. Thanks for all of your help getting this to the finish line. |
Jenkins re test this please |
I'm going to merge this now rather than wait for unrelated test failure - we should get Paypal onto guzzle so we can prevent those fails |
Overview
At some point, a method was copy-pasted, then modified. This is a partial / reviewer's cut of #10941 which reconciles the differences and reduces code duplication.
Before
No functional change, code tidy up
After
No functional change, code tidy up
Technical Details
This is a partial of #10941 but it skips the conversion from string to integer which had been queried & also the changes in calling functions, which I think is not required for a 'no-change' outcome.
In fact relativeToAbsolute only returns a date-only string or one of the default time strings ('000000' for 'from' or '235959' for 'to'). However, it is unreliable - e.g this.week does not append 235959 when it should so we should continue to ignore the time returned from this function
The original commit changed the way this was called by a bunch of reports. I have not carried that over as it should not be necessary now to call these functions differently to achieve the same result
Comments
@MegaphoneJon Please check this - if you are happy with it I will merge & you can evaluate whether there are additional changes in your PR that you wish to follow up with