Enabling new entity types on form throws error

Created on 22 April 2025, 5 days ago

Problem/Motivation

The website encountered an unexpected error. Try again later.

TypeError: array_diff(): Argument #1 ($array) must be of type array, null given in array_diff() (line 64 of modules/contrib/rabbit_hole/src/BehaviorSettingsManager.php).
Drupal\rabbit_hole\BehaviorSettingsManager->disableEntityType() (Line: 129)
Drupal\rabbit_hole\Form\RabbitHoleSettingsForm->submitForm()

Steps to reproduce

Go to `/admin/config/content/rabbit-hole` enable `Content` and see on form save.

Proposed resolution

Add null operator check on line 64 in BehaviorSettingsManager.php

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

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

Merge Requests

Comments & Activities

  • Issue created by @EthanT
  • Merge request !84Edit BehaviorSettingsManager.php β†’ (Open) created by EthanT
  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida
  • Pipeline finished with Success
    5 days ago
    Total: 335s
    #479648
  • πŸ‡ΊπŸ‡ΈUnited States calebtr

    I also ran into this error when updating from 1.0 to 2.0-beta.

    This solution worked for me.

    It is a one-line change. I am marking 'Needs Review' so maintainers see it.

  • πŸ‡¨πŸ‡΄Colombia juandhr Manizales

    Hi, I followed the steps to reproduce the error described in the issue.

    After applying the fix from the merge request branch, the error no longer occurs when saving the form at /admin/config/content/rabbit-hole with the Content option enabled.

    I can confirm the issue is resolved with this change, so I'm moving the issue to RTBC.

    Thanks for the fix!

Production build 0.71.5 2024