studioespresso / craft-date-range

Date range field for Craft CMS
MIT License
12 stars 5 forks source link

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

Closed taher-amici closed 2 years ago

taher-amici commented 3 years ago

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 commented 3 years ago

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.

janhenckens commented 3 years ago

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

janhenckens commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

Should be fixed in today's update!

carolineboeykens commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Sure, Thanks for quick response mate. @janhenckens

janhenckens commented 2 years ago

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