Home › Toolset Professional Support › [Assigned] Views post date filters not working correctly on 31st day of the month
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 14 replies, has 3 voices.
Last updated by Christopher Amirian 8 months ago.
Assisted by: Minesh.
I am trying to: Filter posts by month on the 31st of October
Link to a page where the issue can be seen: The issue only seems to occur on the 31st day of a month so it's difficult to create a link
I expected to see: Posts correctly filtered
Instead, I got:
When filtered posts are returned, for certain months the returned posts are incorrect and return the month following the requested month's posts .
This seems to only affect months that do not have 31 days in them.
Example filter:
Select posts whose
Published date is equal to: year:VIEW_PARAM(2024), month:VIEW_PARAM(09)
Below is a list of examples tested in this view filter (when run on 2024-10-31)
/2022/11/ Returns all posts from 2023/12/
/2023/02/ Returns all posts from 2023/03/
/2023/04/ Returns all posts from 2023/05/
/2023/06/ Returns all posts from 2023/07/
/2023/09/ Returns all posts from 2023/10/
/2023/11/ Returns all posts from 2023/12/
/2024/02/ Returns all posts from 2024/03/
/2024/04/ Returns all posts from 2024/05/
/2024/06/ Returns all posts from 2024/07/
/2024/09/ Returns all posts from 2024/10/
When run today (2024-11-01), all posts returned for the requested dates are correct.
This is obviously not easy for me to replicate and provide an example URL examples for as the problem no longer occurs.
Please let me know if you require any further information.
Hello Oliver,
Thanks for contacting us.
Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.
To clarify, it sounds like your filter is set with fixed values, like the example you provided (year and month specified directly, rather than using a variable such as "last month"). And even being a fixed date, the current date you're seeing the page in the front end is producing different results with the filter?
And it affects not only the current month, but all the previous months as well as long as you do the search on a 31st date?
I'm sorry if I'm being repetitive, I'm just trying to get confirmation and understand the issue better, as we haven’t encountered similar reports, and it does seem quite unusual.
Could you please share a screenshot of the filter configuration? This will help us review the setup and identify any potential issues.
Thank you for your cooperation, and we’ll work to get this resolved for you!
Best regards,
Mateus
We have an archive page that filters by date depending on the URL.
eg: example.com/2024/02/
The filter dynamically assigns the year and month based on the URL. I have attached 2 screenshots of this flter.
On 2024-10-31 this was not working correctly as outlined in the original ticket.
When investigating, I created a new page with static filters in order to try to identify what was going wrong.
My suspicion was that there was an issue with some code in our system and how the dynamic filters were being populated.
It turned out that the filters were all correct and dates were as expected.
I then set up a test page and set the filters to static dates (per the attached screenshot3.png) and tested the previous 24 months.
The results were as follows:
Published date is equal to: year:VIEW_PARAM(2022), month:VIEW_PARAM(11) Returns only posts from 2022/12/
Published date is equal to: year:VIEW_PARAM(2023), month:VIEW_PARAM(02) Returns only posts from 2023/03/
Published date is equal to: year:VIEW_PARAM(2023), month:VIEW_PARAM(04) Returns only posts from 2023/05/
Published date is equal to: year:VIEW_PARAM(2023), month:VIEW_PARAM(06) Returns only posts from 2023/07/
Published date is equal to: year:VIEW_PARAM(2023), month:VIEW_PARAM(06) Returns only posts from 2023/10/
Published date is equal to: year:VIEW_PARAM(2023), month:VIEW_PARAM(11) Returns only posts from 2023/12/
Published date is equal to: year:VIEW_PARAM(2024), month:VIEW_PARAM(02) Returns only posts from 2024/03/
Published date is equal to: year:VIEW_PARAM(2024), month:VIEW_PARAM(04) Returns only posts from 2024/05/
Published date is equal to: year:VIEW_PARAM(2024, month:VIEW_PARAM(06) Returns only posts from 2024/07/
Published date is equal to: year:VIEW_PARAM(2024), month:VIEW_PARAM(09) Returns only posts from 2024/10/
When I returned to continue looking into the problem the following day (2024-11-01) to troubleshoot further, everything was working as expected.
This is when I realised that the affected months that were reporting incorrectly were all shorter than 31 days and that the issue seemed to be limited to the date I was testing on.
Please let me know if anything is unclear or you require any further information.
Kind regards,
Oliver
Apologies, on reviewing my response I realised that my screenshot for my static test was incorrect and have attached the correct one here.
Also, something that may be unclear: all other static month tests were fine. The ones listed are the only ones that were returning unexpected results.
Please let me know if anything is unclear or you require any further information.
Kind regards,
Oliver
Hello. Thank you for contacting the Toolset support.
When I checked I found that you are using outdated Toolset View's plugin version. The current Toolset View's plugin version is: 3.6.16
We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
OR
You can install/update Toolset pluigins using the installer plugin:
-https://toolset.com/faq/how-to-install-and-register-toolset/#automatic-installation-once-you-have-otgs-installer-plugin-installed
Once you update plugin to latest version please try to deactivate and reactivate again and then check if you able to see the same issue.
However - here is the Doc that you should try to follow:
- https://toolset.com/course-lesson/filtering-toolset-views-by-dates/
Hello,
I feel like you have not really read this ticket well and are just telling me to upgrade because the plugin is outdated rather than looking into the issue that I have spent hours looking into and documenting.
Once I have upgraded, can you please provide me detailed instructions as to how I go about testing if the issue is resolved?
I have read the release notes for v 3.6.16 which is 1 patch version above the version we are currently running and can find no reference to an issue of this sort being resolved so am doubtful that this is the resolution but am prepared to give it a try if you let me know how I should go about getting this confirmed.
Thanks,
Oliver
As shared with my previous reply, we always recommond to run with latest plugin version so that we should be on same platform and confirm the issue if found.
Once you update the plugin, please share admin access details and problem URL and with what links you have issue with.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hello Minesh,
Have you read the ticket beyond looking at the version number of the plugin in use.
Even when the plugin is up-to-date, how do you recommend I test this to see if the problem has been resolved?
Kind Regards,
Oliver
Yes, I read the ticket that you are having issue with the specific date that is: 2024-10-31
Can you please send me admin access details with the problem URL of what archive you created and please confirm that I need to test this with the date 2024-10-31.
Also, To confirm we are on same platform, please share few dates that I should use to test the results against with what date its working and with what dates its not working.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hello Minesh,
I don't think that you correctly understand the problem.
Everything is fine on the site now, and I assume that it will be fine until 2024-12-31 when I suspect that the problem will re-occur.
I am happy to provide you access to a development /testing server that we have but I do not see that there is any point in doing so as there is currently no problem and you will not see anything beyond what you would expect.
In order to replicate this bug, you would need to have a server set up with Toolset views, the server date set to 2024-10-31 and then try to filter posts by date.
Hopefully this clarifies the issue a bit better. Please advise what you think the best next steps are.
Kind Regards,
Oliver
You mean to see the issue:
- I should setup the server and set server date to: 2024-10-31
- Then create a view/archive and add date query filter and filter the posts with the same date where year should be 2024 and month should be 10
- And I should check the results that it should only return the posts belongs to year 2024 and month 10 - is that correct?
That is partly correct.
In order to see the issue, you should:
Setup the server and set server date to: 2024-10-31
Then create a view/archive and add date query filter and filter the posts with the year and months as follows:
/2024/02/ Returns all posts from 2024/03/
/2024/04/ Returns all posts from 2024/05/
/2024/06/ Returns all posts from 2024/07/
/2024/09/ Returns all posts from 2024/10/
Please let me know if this is unclear.
Kind Regards,
Oliver
Is is the case that I need to set the server date to old date than the current date?
The server date would need to be set to: 2024-10-31 (or, I assume but cannot confirm, the 31st of any month that has 31 days)
Hi,
This is Christopher, Minesh is on vacation for the time being. We will get back to you as soon as he returns back as I am not sure how to investigate the issue like he would do.
Thank you for your patience.