Navigation überspringen

[Zugewiesen] Problemas con el filtro de una vista

This support ticket is created vor 2 Wochen, 3 Tage. 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.

Dieses Thema enthält 0 Antworten, hat 1 Stimme.

Zuletzt aktualisiert von Rafael Corts vor 12 Stunden, 27 Minuten.

Assistiert von: Christopher Amirian.

Author
Artikel
#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

Sprachen: Englisch (English )

Zeitzone: 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

Sprachen: Englisch (English )

Zeitzone: 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:
- versteckter 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:
versteckter 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

Sprachen: Englisch (English )

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

With the view you shared:
- versteckter 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

Sprachen: Englisch (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.

versteckter Link

versteckter Link

Page:
versteckter Link

Best regards,
Rafa Corts

#2789558

Christopher Amirian
Supporter

Sprachen: Englisch (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.

#2790001

What I need is to create a view with past events, starting from September 1, 2024, up to today. The first view is correct, and for the second one, I need to see the events that have already taken place starting from September 1.

Thank you.
Rafa corts

#2790013

Christopher Amirian
Supporter

Sprachen: Englisch (English )

Hi Rafa,

I created a new page with a new view and when added the items it only shows 18 items:

versteckter Link

There seems to be some sort of custom code that you use or something that I am not sure which is it.

Please test by doing the steps below:

- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Event Calendar, Toolset and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.

Thanks.

#2790036

Hello, I think you don't understand the question, and you don't know what I'm asking. It's as simple as creating a view with a filter, which you will see on the page I mentioned, where it is sorted by events that have already occurred. I have created a custom date field, and there is nothing more to it. We are at the starting point, and I don't know if you understand the problem I'm having with the view I created. I have applied some filters, but they are not showing up. Date filter to display past events.
Rafa corts