Problem/Motivation

I am seeing a javascript error on the private-message/create page

TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at ce.fn.init.val (jquery.min.js?v=3.7.1:2:67761)
    at HTMLInputElement.<anonymous> (private_message_members_widget.js?v=10.2.7:485:19)
    at Function.each (jquery.min.js?v=3.7.1:2:3129)
    at ce.fn.init.each (jquery.min.js?v=3.7.1:2:1594)
    at removeMember (private_message_members_widget.js?v=10.2.7:484:45)
    at private_message_members_widget.js?v=10.2.7:521:9
    at dispatch (jquery.min.js?v=3.7.1:2:40035)
    at v.handle (jquery.min.js?v=3.7.1:2:38006)

This is preventing the user from the autocomplete field from being added to the hidden form field and submitting the form results in the error message "You can not send a message to yourself only."

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Tag1 fosters the development of DrupalTag1 logo

Comments

loze created an issue. See original summary.

loze’s picture

Not exactly sure why, but apparently inside the .each() functions $(this) was undefined. so instead I changed it to use the element parameter in the each function. This MR seems to resolve the issue for me.

loze’s picture

Status: Active » Needs review