- Issue created by @davidiio
- Status changed to Postponed: needs info
6 months ago 7:43pm 18 June 2024 - π§πͺBelgium davidiio
I can't upgrade this website to D10 right now. We're stuck with 9.5.11 and so we can't use BEF 7 version. I could try it on other sites but here I would like it to work on D9.5.11 and BEF 6.0.6. Downgrading to BEF 6.0.5 made it work though.
We have a view of node filtered by a date field (not the created date) we enabled BEF and selected the datepicker widget for this exposed date filter and got the warning I mentioned, there is nothing else I could say about this issue. When I don't use the datepicker filter is working.
- πΊπΈUnited States smustgrave
6.0.6 is where jquery was replaced. But the snippet supplied shows a function that is now removed in D10 so this may be a non issue going forward.
- Status changed to Closed: duplicate
4 months ago 2:59pm 29 August 2024 - πΊπΈUnited States smustgrave
Seems to be a dup. That one has an MR so closing this one.
- Status changed to Active
about 1 month ago 2:31pm 13 November 2024 Reopening as I believe the linked issue π Warning: Undefined array key "#type" in Drupal\\better_exposed_filters\\Plugin\\better_exposed_filters\\filterDatePickers->exposedFormAlter() (line 65 of /var/www/html/web/modules/contrib/better_exposed_filters/src/Plugin/better_exposed_filters/filter/Dat Active was originally referring to a different warning (Undefined array key
"#type"
not"type"
) which I did not encounter btw.I was able to confirm that this was caused by Remove dependency on jquery_ui_datepicker π Remove dependency on jquery_ui_datepicker Needs work .
In the above issue, we started setting
'#type' = 'date'
, doing so will run theprocessDate()
method since it's a process function defined incore/lib/Drupal/Core/Render/Element/Date.php::getInfo()
.However, since the info provided by that method is altered by
DatePickers::exposedFormAlter()
and because we're manipulating the'#attributes'
key, the default$element['#attributes']['type'] = ['date']
that is defined ingetInfo()
is lost.Setting it whenever we set the
'#type'
to'date'
fixes the issue.I understand that we may not be interested in fixing this in
6.0.x
, but I believe we should since we commited the reason behind this issue to6.0.x
.I'm uploading a patch anyways which can be used by sites that cannot upgrade to Drupal 10 yet.
Also, this wouldn't affect
7.0.x
sinceprocessDate()
method was removed in Drupal 10. I didn't test it though.-
smustgrave β
committed a84e75ee on 6.0.x
Issue #3454581 by redwan jamous, smustgrave, davidiio: Datepicker plugin...
-
smustgrave β
committed a84e75ee on 6.0.x
- πΊπΈUnited States smustgrave
Trying to shut down 6.0.x but this change is small enough I'll add to the dev branch.