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

isFuture / isOngoing / isPast Not working after craft add postfix to fields in content table #26

Closed
taher-amici opened this issue Oct 29, 2021 · 10 comments
Assignees

Comments

@taher-amici
Copy link

isFuture / isOngoing / isPast is not working after craft cms recent update
https://user-images.githubusercontent.com/51078042/139384619-4e9de187-5d1c-4412-96b9-4eaea14cbf63.png
give this error.

Additional info
Craft version: 3.7.12
PHP version: 7.4
Database driver & version: 8.0.23
Date range Plugin: 2.3.0

@taher-amici
Copy link
Author

For temporary solution I added postfix to my template and it works like this (eventDate_jvkedgsw). you can get this postfix to your content table. Can you just fix this bug in next release.

@taher-amici taher-amici changed the title isFuture / isOngoing / isPast Not working after craft add prefix to fields in content table isFuture / isOngoing / isPast Not working after craft add postfix to fields in content table Oct 29, 2021
@janhenckens
Copy link
Member

Hey @taher-amici, thanks for reporting this! Will have a look over the weekend.

@janhenckens janhenckens self-assigned this Oct 29, 2021
@janhenckens
Copy link
Member

@taher-amici Could you share how you're using the field in your template? I can't seem to reproduce the issue on my end.

@taher-amici
Copy link
Author

taher-amici commented Oct 30, 2021

yeah sure I was getting error when using .isFuture() or any other filer on my craft query like this:
craft.entries.section('events').limit(5).orderBy('eventDate asc').isFuture(fieldHandle).all()

janhenckens added a commit that referenced this issue Nov 1, 2021
@janhenckens
Copy link
Member

Should be fixed in today's update!

@carolineboeykens
Copy link

carolineboeykens commented Nov 3, 2021

Is it possible that you are now using the field name instead of the field handle? It broke some things here after the update

{% set entries = craft.entries.section('activities').isFuture('activityDate', true) %}

Screenshot 2021-11-03 at 14 31 07

@taher-amici
Copy link
Author

yes I also get the error after the update still not working.
{% set entries = craft.entries.section('events').isFuture('eventDate') %}
https://user-images.githubusercontent.com/51078042/140071381-6f810961-4158-4fc0-8de0-0c78e126e78e.png

@janhenckens janhenckens reopened this Nov 3, 2021
janhenckens added a commit that referenced this issue Nov 3, 2021
@janhenckens
Copy link
Member

Whoops, my bad! My fields had the same name & handle so it didn't pop up in my testing. Just pushed a fix for this, call you install that and try? @carolineboeykens @taher-amici

@taher-amici
Copy link
Author

Sure, Thanks for quick response mate. @janhenckens

@janhenckens
Copy link
Member

I'm assuming this is fix now so closing the issue, let me know if it's not :)

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

No branches or pull requests

3 participants