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
| Comment | File | Size | Author |
|---|
Issue fork token-3531017
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
Comment #3
vasyl vasylkiv commentedAttaching the patch from the MR
Comment #4
igorgoncalves commentedHi 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!
Comment #5
johnatas commentedHello,
Like @igorgoncalves, I’m not able to reproduce the issue on my end with the following versions: