Problem/Motivation

The date-picker-init.js contains functionality to disable our date picker and use the native date picker. However it checks the settings in a way that sometimes causes errors.

Uncaught TypeError: Cannot read property 'includes' of undefined
at <anonymous> (sites/default/files/js/js_btajuj9K1lg9zE9NpUDkj8AvZue9INhtOIuC-g_kbnk.js:529:632)
at each (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:2:2976)
at <anonymous> (sites/default/files/js/js_btajuj9K1lg9zE9NpUDkj8AvZue9INhtOIuC-g_kbnk.js:529:557)
at each (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:2:2976)
at each (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:2:1454)
at attach (sites/default/files/js/js_btajuj9K1lg9zE9NpUDkj8AvZue9INhtOIuC-g_kbnk.js:529:538)
at <anonymous> (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:60:24)
at attachBehaviors (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:57:34)
at <anonymous> (sites/default/files/js/js_LrvLT18k266WIMCbdpQ15JOYfPOhgD_CFr2Tgpq6BDE.js:2400:20)

Steps to reproduce

Proposed resolution

Properly use typeof variable !== "undefined" checks and improve the overall code structure.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 socialbase-3214965-2.patch5.9 KBkingdutch

Comments

Kingdutch created an issue. See original summary.

kingdutch’s picture

Assigned: kingdutch » navneet0693
Status: Active » Needs review
StatusFileSize
new5.9 KB
kingdutch’s picture

For historical purposes, the original code was introduced in https://git.drupalcode.org/project/socialbase/-/commit/f49c0bdb509dae382...

ronaldtebrake’s picture

Status: Needs review » Fixed

Will be in 1.1.2 thanks!

navneet0693’s picture

Assigned: navneet0693 » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.