Sauter la navigation

[Fermé] Follow on from "[Closed] Critical error – Toolset view"

This support ticket is created Il y a 1 année et 7 mois. 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.

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 1 année et 7 mois.

Auteur
Publications
#2626159

Hi

Sorry for the slow reply, my previous ticket got closed.

It seems to be an issue with the custom code snippet you provided:


add_filter( 'wpv_filter_query', 'func_custom_date_filter_query', 10, 3);
function func_custom_date_filter_query( $view_args, $view_settings, $view_id ){
  
    if ( 71155 == $view_id ) {
  
            if ( (isset($view_args['meta_query'])) && (!empty($view_args['meta_query'])) ) {
    
             $target_field = "_wpscp_schedule_draft_date"; // change this field slug to your field slug
                 
            foreach ($view_args['meta_query'] as $key => $value):
                      
              if ($value['key'] == $target_field){

                $date_range = explode(",",$value['value']);	
                $start = date('Y-m-d', $date_range[0]);
                $end = date('Y-m-d', $date_range[1]);
                $view_args['meta_query'][$key] = array('key' => $target_field, 
                                                       'value' => array($start,$end), 
                                                       'type' => 'DATE', 
                                                       'compare' => 'BETWEEN' );
              }
            endforeach;            
        }
         
    }
  
    return $view_args;
}

Any ideas why this may have suddenly stopped working?

Says fatal error.
/public_html/wp-content/toolset-customizations/toolset-custom-code.php on line 21

Thanks.

#2626593

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Matt

Do you have details of what the error actually is?

Your debug.log should give details of the error other than just the line number.

(Christopher shared how to turn on the debug.log if it is not already active in the last thread.)

Le sujet ‘[Fermé] Follow on from "[Closed] Critical error – Toolset view"’ est fermé à de nouvelles réponses.