TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array()

Created on 10 August 2023, over 1 year ago
Updated 14 September 2023, over 1 year ago

Problem/Motivation

TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 20 of /app/modules/contrib/dynamic_menu_item/dynamic_menu_item.module)

Steps to reproduce

Enable the module in Drupal 9 instance.
Don't update any configuration.
Try to access the edit form of node.

Proposed resolution

Provided MR

Remaining tasks

Review and merge.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India sakthi_dev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sakthi_dev
  • @sakthi_dev opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sakthi_dev

    Please review.

  • 🇮🇳India NivethaSubramaniyan

    Steps to reproduce:
    1) I have installed the dynamic_menu_item module in drupal 9.5
    2) Without doing any configuration, I opened the edit page of a content
    3) We got an error 'TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array()'.
    4) I have uninstalled the module.
    5) Applied the given patch and installed the module again.
    6) repeating the step 2
    7) Again I got the same error.

    Even after applying the above patch still the issue exists.

    I have attached the image for your reference.

    Solution: We have to rename the file as dynamic_menu_item.settings.yml instead of dynamic_menu_item.config.yml inside config/install folder.

  • Status changed to RTBC over 1 year ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    Thank you! 🍰
    RTBC

  • Status changed to Fixed over 1 year ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    Committed! 🍻

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

Production build 0.71.5 2024