Can't uninstall slick because null given instead of array

Created on 4 November 2022, about 2 years ago
Updated 30 November 2023, 12 months ago

Problem/Motivation

On "drush cim" you get this:

[error]  TypeError: array_diff(): Argument #1 ($array) must be of type array, null given in array_diff() (line 66 of [...]/modules/contrib/slick/slick.install) #0[...]/modules/contrib/slick/slick.in
stall(66): array_diff()

Same when you try to uninstall using "drush pmu" or the UI.

We have this issue in 8.x-2.6, the line how ever is still there in 2.7. So I assume the same issue is there as well.

Steps to reproduce

1. install slick
2. uninstall slick

Proposed resolution

Make sure array_diff gets an array, not null. That's doable by checking if $dependencies['module'] exists.

Remaining tasks

1. Create a PR
2. Merge PR

User interface changes

- none

API changes

- none

Data model changes

- none

💬 Support request
Status

Fixed

Component

Miscellaneous

Created by

🇩🇪Germany SerkanB

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States micahw156

    Yes, this is still a problem. I encountered it today.

    I did some debugging, and determined that in my case, $config->get('dependencies') is returning an empty array, therefore $dependencies['module'] is not set.

    I don't have time to write a patch right now, but it would seem that writing a check to verify this value is set should resolve the problem.

  • 🇺🇸United States micahw156

    I figured out how to uninstall the module and why it's showing null, but I'm not sure where it needs to be fixed.

    The solution was in #3257390: It is not possible to uninstall slick , to open and save every exiting filter configuration.

    Before touching the filter configurations, none of my filter configurations had any dependencies (except markdown). Saving all configurations added the blazy and slick dependencies. Once those dependencies were added, the uninstall worked as expected.

    These missing dependencies seem more like an installation problem than an uninstall problem, but this workaround should help anyone who gets stuck until a patch can be provided.

  • Status changed to Fixed 12 months ago
  • 🇮🇩Indonesia gausarts

    The patch was in for quite a while. And workarounds in #6 should be enough if persists.
    The OP version is outdated as well. But kept it for context.

    Feel free to re-open if still an issue.

    Thank you.

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

Production build 0.71.5 2024