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

Method for Identifying/Handling Items on a List When They No Longer Exist in the Database #74

Closed
kerns opened this issue Jan 29, 2021 · 2 comments

Comments

@kerns
Copy link

kerns commented Jan 29, 2021

Attempting to render a list that contains a reference to an item that has been [soft] deleted from the database will likely throw an Impossible to access an attribute ("something") on a null variable error.

After garbage collection it can be mitigated using something like...

{% for item in list.items.elementId(':notempty:').all() %}

...but maybe there is a better way and one that doesn't depend on garbage collection. 🤔

@engram-design
Copy link
Member

Yep, I think we'll want to add a query param that looks up against the linked element's dateDeleted column, just to ensure we're checking against that correctly and not reliant on garbage collection.

Possibly also test against disabled element's, as they shouldn't be included either.

@engram-design engram-design added this to the 3.0 milestone Nov 13, 2022
@engram-design
Copy link
Member

Added in 3.0.0

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

2 participants