Working with D10 or not?

Created on 25 November 2024, 8 days ago

Problem/Motivation

Wanted to see if this works with Drupal 10

Steps to reproduce

Drop code in to custom module folder and update .info.yaml file to cover ^10

Enable module - no obvious errors

Add a date field and set to expose and 'in between' and date ranges

check preview but just see an empty field.

in logs see

TypeError: Cannot access offset of type string on string in Drupal\views\Plugin\views\filter\NumericFilter->valueForm() (line 314 of /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/NumericFilter.php).

and

#0 /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/Date.php(40): Drupal\views\Plugin\views\filter\NumericFilter->valueForm()
#1 /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php(969): Drupal\views\Plugin\views\filter\Date->valueForm()
#2 /srv/www/cws/my.cancersupport.org.au/web/modules/custom/date_with_defined_ranges/src/DateWithCustomRanges.php(122): Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm()
etc

Proposed resolution

Not asking for any help. just thought I should report my experience in case it saves others wondering if this works to.

Also in hindsight, i don't think this would be the solution i was hoping for, as i was not wanting this for an exposed date field, i just wanted to set a date range to be 'last month' and haven't figured another way of doing this with out-of-the-box Views.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇿New Zealand petednz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024