Skip Navigation

[Résolu] Logged in users see a view differently from guest users

This support ticket is created Il y a 4 années et 8 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Ce sujet contient 11 réponses, a 2 voix.

Dernière mise à jour par luca-pietroU Il y a 4 années et 8 mois.

Assisté par: Nigel.

Auteur
Publications
#1336281

I am trying to:
Display view results

Link to a page where the issue can be seen:
lien caché

I expected to see:
No differences between the guest user view and the logged in user view

Instead, I got:
The view while logged in has duplicates.
The view while logged out is ok with no duplicates.

#1336461

Nigel
Supporter

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

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

I can see the duplicates when logged in.

It appears that something is interfering in the pagination (the duplicates appear in subsequent pages of results, but never in the same page).

If you disable the pagination so that all results are shown, no duplicates appear.

To identify what is interfering in the pagination, it's necessary to test after switching theme to twentynineteen and to disable non-Toolset plugins.

Can you first test the theme.

The difficulty with disabling the non-Toolset plugins is that you are using metabox to create the CPT. I don't know if it could be interfering in the queries for the post types it creates.

You could temporarily disable metabox, add Toolset Types to your site and use it to create the Works CPT (just be sure to give it the same slug, then it will work with your existing Works posts), then test again.

Let me know what you find and we can proceed.

#1336489

It actually happened even logged out.

I will try with types and default theme. I need 2hrs probably due to lunch

#1336501

Removed all the plugins aside toolset
Activated nineteen theme
swapped from metabox to types

still the problem
lien caché

any idea?

you can try and do whatever you want on this website 🙂

#1336537

Nigel
Supporter

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

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

I can't see what the issue is, so I've taken a copy of the site for more testing, and I'll get back to you.

#1336581

Thanks I'll try to downupdate the view plugin to an older version and see if something changes

#1336673

I'll share with you what I discover

I created new custom post types with both metabox and types.
created a new view
added MANUALLY 10 posts to those custom post types
there was no problem with duplication

BUT
when I imported 100 records with WP ALL IMPORT (only title) in those two custom post type
the problem of duplication appeared

so I wonder now how "wp all import" way to create new post could affect toolset view (it just creates 100 post with just the title nothing more)

- - -

update 2

I trashed the 100 new post.
then restored them one by one
there are some post that cause the duplicated issue while other works fine.
not sure why. they have only the title.

- - -

update 3

the problem seems to occur after 15 posts whenver they are created manually or with wp all import

#1336687

Nigel
Supporter

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

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

I did quite a bit of testing in my local copy of the site and couldn't determine the problem, so I've passed it to my colleagues in second tier so that they can do some deeper debugging, and I'll let you know what they find.

I did notice that ordering the results by post_id instead of post_date seemed to eliminate the problem, which you might adopt as a workaround in the meantime (if you can confirm).

#1336691

Thanks. Right now I noticed that after 15 posts the problem appears

i'll try with order by post id as a workaround for now

#1336705

Nevermind is happens with 13 and 14 items too. no idea why it happens anymore.

by the way "solved" by avoiding order by date. thanks. I hope there will be a better solution inthe future

#1338525

Nigel
Supporter

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

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

It seems related to having imported the data and many of the posts have identical dates, which is introducing the difficulty of ordering by date when the dates are the same, in combination with pagination.

As Views is basically a UI-friendly wrapper for the built-in WordPress WP_Query class it may be an underlying problem with that, which you could test by setting up a custom query in PHP that doesn't use Views.

In any case, it can be solved if you order by post_date but include a secondary orderby setting, e.g. by post_date then by post_title.

My colleague found that that removes the duplicates.

Can you confirm the same?

#1340717

My issue is resolved now. Thank you!

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance