Problem/Motivation

When users trigger ajax request on a field widget (social_link_field module) following error appearing on the page:
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 675 of /var/www/html/web/modules/contrib/token/token.module).

Steps to reproduce

1. Install modules: token, social_link_field;
2. Add field of Social Links type to any of content type;
3. Go to the node creating form of content type with social links field;
4. Select one of listed item in the social field widget.

Current behavior: error visible after ajax response.
Expectations: no error visible after ajax response.

Proposed resolution

For token_node_menu_link_submit Entity builder add additional condition to check button submit presents

CommentFileSizeAuthor
#3 token-3531017-3.patch770 bytesvasyl vasylkiv

Issue fork token-3531017

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:

Comments

vasyl vasylkiv created an issue. See original summary.

vasyl vasylkiv’s picture

Status: Active » Needs review
StatusFileSize
new770 bytes

Attaching the patch from the MR

igorgoncalves’s picture

Hi Vasyl, thanks for the patch.

But i couldn't reproduce the error, even following the steps you provided.

Here the versions i tested on simplytest.me:

Drupal: 11.3-dev
social_link_field: 2.1.0
token: 8.x-1.x-dev

Can you provide more details? thanks!

johnatas’s picture

Hello,
Like @igorgoncalves, I’m not able to reproduce the issue on my end with the following versions:

  • Drupal core: 11.2.2
  • Token: 8.x-1.15
  • Social Link Field: 2.1.0