Skip Navigation

[Resolved] Date filter doesn't work on views

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by nickH-5 3 years ago.

Assisted by: Shane.

Author
Posts
#1915023

I'm finding that the filter in a view like Select posts whose Published date is after or equal to: week:PAST_ONE(2)

This is an issue on more than one of our views, and the views have not been changed. It appears that the filter achieves nothing now and all posts are shown regardless of published date

#1915293

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

Thank you for getting in touch.

Were there any new plugins installed or updated recently ? If so can you temporarily disable all the non-toolset plugins and check again to see if the issue remains.

If the issue remains please let me know and provide the credentials and a link to the view so that I can have a more detailed look at this one for you.

Thanks,
Shane

#1925607

It will take me a few days to create a clone as I don't want to disable plugins on the live site

#1926699

I have created a clone site

I have deactivated all except Toolset plugins and deactivated Avada theme and activated twenty twenty one theme

The issue remains (for example the view named "internal-view-public-blog-posts" - post 139165)

You can see the posts being listed on the page under the heading "UPDATES FROM LOCAL ORGANISATIONS". This is all of the posts in CPT "public blog post" with attribute wpcf-origin="external" and not just those from the previous 14 days.

I can provide access details if you provide private messaging

#1928185

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

Yes please provide the login details.

I've enabled the private fields for your next response.

Thanks,
Shane

#1929651

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

I believe I know the issue thats going on here, however can you confirm if this had previously working in the past ?

Thanks,
Shane

#1929725

Thanks Shane

Yes this worked previously.

Nick.

#1932143

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

I must apologize for the delay in response. We have a code snippet that should resolve this one for you .

function tssupp_filter_query($view_args, $view_settings, $view_id)
{
    $view_ids = array( 123, 456 ); // Edit for View IDs to apply to

    if ( in_array($view_id, $view_ids) ) {
 
        $view_args['date_query'] = array(
            'after'     =>  '2 weeks ago',
            'column'    =>  'post_date'
        );
    }
    return $view_args;
}
add_filter('wpv_filter_query', 'tssupp_filter_query', 101, 3);

Just add this to your site and replace the ID in the function with the ID of you view and let me know if this helps.

Thanks,
Shane

#1932163

Thanks. This isn't a very scalable solution. Does this mean there is a known issue with date filters and will this be worked on?

#1935311

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

Sorry for the delay in response.

We are indeed aware of the issues with this particular filter, however I will need to log a ticket for improvements on the date filter. I cannot guarantee that improvements will come soon but I know that our team is aware of the issue.

For now you will need to use the query filter as a workaround for this issue.

Thanks,
Shane

#1935599

Thanks.

This seems like a really big issue as it effectively renders views with date filters unusable so I hope this will make it to near the top of any work prioritisation.

#1935639

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

I understand your concern and raised it with the team to bring it to our developers. I've also provided a copy of a test site with the issues replicated.

Thanks,
Shane

#1938337

Confirming that the workaround appears to work but I think you should be aware that the issue is not appearing on the list of known issues. I worry that it isn't going to get fixed by your team.

#1938405

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

Not all the issues that were raised will be added as quickly as they are identified.

Our development team will need to look at it and perform an assessment of the issue. I know there are plans to improve the query filters and i've already made a second tier ticket for this issue to be reviewed. Not much else I can do from my end given that I've provided the required information as well as the steps to correctly replicate.

Thanks,
Shane

#1996131

I remain concerned about this which is still not showing as a "known issue". I now have other views which this same issue is affecting. Is anyone going to provide a proper fix for what seems to me to be a major issue.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.