Skip Navigation

[Gelöst] cred_save_data and relationship

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

The issue here is that the user is pulling the relationship data in their CRED hook but its not pulling the current set relationship but the previous one.

Solution:

If this is happening to you I would suggest that you change your CRED hook to one that fires later.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

This support ticket is created vor 5 Jahren, 4 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 18 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Pat vor 5 Jahren, 4 Monaten.

Assistiert von: Shane.

Author
Artikel
#1276143

Pat

Hi Shane,

I don't understand your screenshot.

Everything should be made in the front end (not in the back end) and when I'm trying to use it, the title is not changed after the first submission.

Here is exactly what I am doing :

1. Go to the page page backoffice/gestion-des-stages/ => you should have a Views with the list of the "stages"
2. Click on Modif in the right of the first line. Look at the the current title before. This title includes the name of the stage location. It can have 2 different values :Vaulx en Velin – Salle 1 or Saint Quentin Fallavier
3. When you are in the modification page, change the "Lieu du stage" and use not the one that is currently in the title and submit. .
4. Normally, after submission, the title should be upgraded with the name of the location you have chosen (you have the title in the Views (left column) of the backoffice/gestion-stage page where you are redirected after Cred submission). For me, the title is not changed after the first submission !

Regards
Pat

#1276157

Shane
Supporter

Sprachen: Englisch (English )

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

Hi Pat,

Thank you for the clarity.

I now see what you mean by you have to submit it twice.

I'll be doing some debugging on your code to see where the fault is.

Thanks,
Shane

#1276717

Shane
Supporter

Sprachen: Englisch (English )

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

Hi Pat,

Should now be working fine now.

I changed the hook to use this one instead
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

This way we ensure that all the data is saved to the database. It could be that the relationship data is being saved later and we are retrieving it a little too early.

Thanks,
Shane

#1277185

Pat

Hi Shane,

That's working fine now. Thanks for your time.

It seems that the database record of the relationship took more time than planned and the function you proposed was closing the issue.
Perhaps would it be good to add some info in the documentation page in order to explain what could be the cases that needs to use it instead of the standard red_save_data !

Regards
Pat