Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforeValidate hook changes still require page refresh to reflect changes with versions enabled. #10515

Open
HarleySalas opened this issue Jan 11, 2025 · 2 comments
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@HarleySalas
Copy link
Contributor

HarleySalas commented Jan 11, 2025

Describe the Bug

I celebrated too early upon seeing #9691 and #10268, however, the issue still persists for me when versions are enabled for a collection.

when beforeValidate hooks run, their changes are not reflected in the UI until a user manually refreshes the page.

Link to the code that reproduces this issue

https://github.com/HarleySalas/payload-3-reproductions/tree/before-validate-requires-refresh

Reproduction Steps

clone the repo. sqlite contains the necessary data. You will be autologged in and you can visit the page collection to observe the behavior by removing the slug field and saving the document to get the slug to be generated via the Title field. Removing versions results in it working fine. As soon as it's got versions enabled, it just stops working and requires a full refresh to see changes reflected on the page.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Payload: 3.16.0
Node: 22.2.0
SQLite, Postgres 16
@caseyszilagyi
Copy link

caseyszilagyi commented Jan 15, 2025

I'm also having the same issue on 3.16.0. I have versions, drafts, and autosave enabled.

I also experienced the same thing with the beforeChange hook

@jmikrut
Copy link
Member

jmikrut commented Jan 15, 2025

I plan to look into this ASAP - just giving a quick update here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants