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

GridFields show "archived" for all records with non-staged applications of Versioned #391

Open
NightJar opened this issue Jan 24, 2023 · 2 comments

Comments

@NightJar
Copy link

$isModelVersioned = $model::has_extension(Versioned::class);

The check here is too simplistic, as Versioned can be applied in 2 ways - as the familiar publishing staged content variation (default), or as a simple history tracking variation (.versioned).

If one applies "history-only" variant, then there is no stage to track, and the default GridField extensions do not allow for this, showing "archived" as the state for all records e.g. in a ModelAdmin.

The highlighted check above should also include && $model->hasStages() in the evaluation.

@kinglozzer
Copy link
Member

@NightJar Is this after you apply the extension to a pre-existing model? I have models using Versioned::class . '.versioned' and can’t reproduce this, but I do remember when I first applied versioning I had to go through and re-save them all. From memory if Version=0 in the “live” table, the archive flag shows

@NightJar
Copy link
Author

NightJar commented Jan 30, 2023

Is this after you apply the extension to a pre-existing model?

Yes it was.
I don't think there is a _Live table if there's no staging.
***edit
yeah there's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants