Skip Navigation

[Waiting for user confirmation] Problemas con el filtro de una vista

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.

This topic contains 0 replies, has 1 voice.

Last updated by Christopher Amirian 19 hours, 18 minutes ago.

Assisted by: Christopher Amirian.

Author
Posts
#2787312
error-de-filtro-vista.jpg

Hola tengo una Vista para mostrar unos eventos, la cuestión es que me está haciendo cosas raras, dentro de la vista tengo un filtro para filtrar los eventos que se han realizado del 1 de setiembre del 2024, a día de hoy, te adjunto imagen para que puedas ver el filtro configurado, antes funcionaba correctamente, pero ahora no sé muy bien que está sucediendo y también se muestran los eventos que aún no se han hecho.
Saludos.
Rafa Corts

#2787469

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Spanish support is not available. I'll try to guide you in Engllish.

I would like to know the date field you are trying to filter with - is it created using Types plugin or it is third party plugin's custom date field?

Can you please share problem URL where you added the view as well as admin access details.

*** 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.

#2787609

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Frist of all, can you pleaes update ALL plugins to its official latest version on yur staging site.

If I remove the date filter you added - When I check the query generated by view, I see the following:

SELECT   (wp_tec_occurrences.occurrence_id + 10000000) as occurrence_id
					 FROM wp_posts  LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  INNER JOIN wp_tec_occurrences ON wp_posts.ID = wp_tec_occurrences.post_id
					 WHERE 1=1  AND ( 
  wp_term_relationships.term_taxonomy_id IN (8)
) AND ( 
  wp_postmeta.meta_key = 'wpcf-data-esdeveniment' 
  AND 
  ( 
    wp_tec_occurrences.post_id IS NOT NULL 
    AND 
    CAST(wp_tec_occurrences.end_date AS DATETIME) >= '2024-12-11 14:46:22'
  )
) AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private'))
					 GROUP BY wp_tec_occurrences.occurrence_id
					 ORDER BY wp_postmeta.meta_value+0 DESC, wp_tec_occurrences.start_date ASC, wp_posts.post_date ASC
		

I see it adds:

CAST(wp_tec_occurrences.end_date AS DATETIME) >= '2024-12-11 14:46:22'

I'm not sure why it adds this.

We do not added any end_date filter with the view you have:
- hidden link

Are you using any custom code anywhere?

#2787648

Hola no acabao de entender lo que me estas diciendo, el filtro que tenis puesto es para mostrar los eventos ya realizados des de el setiembre hasta el dia de hoy .
De todas maneras sigue sin hacerlo bien, ya que muestra eventos que no se han realizado.

¿No entiendo que quieres decir con esta frase? "Are you using any custom code anywhere?"

¿Tu sabes cual es mi problema?
Saludos.
Rafa Corts

#2787649

Hola La vista que indicas no es la correcta, es esta:
hidden link

En esta pagina de monograficos tengo dos vistas, la primera muestro los eventos del futuro y la segunda vista muestro los eventos ya pasados.

Saludos.
Rafa Corts

#2787861

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

With the view you shared:
- hidden link

I do not see they custom date filter that you shared with your intial reply.

With the above view - do you want to dispaly past events or future events?

Do you mean with the above view you want to apply the custom date filter and want to display the events where the custom date field value falls from 01-09-2024 To today's date?

#2788029

Hola, ahora sí que está el filtro de la fecha, lo que dices es correcto , necesito crear dos vistas, la primera que muestre los eventos del futuro y la segunda que muestre los eventos pasados desde el 1 de setiembre hasta el día de hoy.

Ahora, por lo que he visto, en la página donde se muestra el listado de eventos pasados, si marcamos "buscar" en el buscador, aparecen los dos eventos. ¡Correcto! ¿Pero no debería de mostrar los dos eventos directamente sin tener de marcar el botón de buscar?

Saludos.
Rafa Corts

#2788527

Christopher Amirian
Supporter

Languages: English (English )

Hi Rafa,

This is Christopher. Minesh is on vacation, so I will take over the ticket.

We can not give support in Spanish, I'd appreciate it if you could reply back in English.

That is an expected behavior because there are two views involved.

Thanks.

#2788729
filtro-vista-2.jpg
filtro-vista-1.jpg

Hi Christopher,

On one of the pages, I have two views. The first view is meant to display past events, from September 1, 2024, to today, and the second view shows upcoming events. Now, the issue is that it’s doing some strange things. Within the view, I have a filter to show only events that occurred from September 1, 2024, to today. I’m attaching an image so you can see the filter configuration. It used to work correctly, but now I’m not sure what’s happening, and it’s also showing events that haven't happened yet.

From what I see now, in the "Completed Events" view, nothing is displayed until the event search filter is checked, and only then do the completed events appear. Initially, it should display all the events, and the search filter should be used to find specific events.

hidden link

hidden link

Page:
hidden link

Best regards,
Rafa Corts

#2789558

Christopher Amirian
Supporter

Languages: English (English )

Screenshot 2024-12-22 at 5.11.20 PM.png

Hi Rafa,

Sorry for my late reply, we are in the holiday season and the turnaround will be longer.

The first view which has the future dates shows ok.

The reason the second view does not show anything is that there is no entry before the date you have set. So as soon as I removed the filter I saw that there are only 3 entries and they all are on Jan 2025. It is normal to show no results with the filter you have had since September.

Thanks.