Skip to content

Add defensive coding to prevent warnings if module is in database but not the file system #473

@laryn

Description

@laryn

Defensive coding could be added to prevent messy output like this:

⚠️ Warning: Undefined array key "xmlsitemap"
in enable_bee_callback() (line 217 of /usr/local/bin/bee/commands/projects.bee.inc).

⚠️ Warning: Attempt to read property "info" on null
in enable_bee_callback() (line 218 of /usr/local/bin/bee/commands/projects.bee.inc).

⚠️ Warning: Trying to access array offset on null
in enable_bee_callback() (line 218 of /usr/local/bin/bee/commands/projects.bee.inc).

⚠️ Warning: Attempt to read property "status" on null
in enable_bee_callback() (line 221 of /usr/local/bin/bee/commands/projects.bee.inc).

⚠️ Warning: Attempt to read property "name" on null
in enable_bee_callback() (line 227 of /usr/local/bin/bee/commands/projects.bee.inc).

⚠️ Warning: array_flip(): Can only flip string and integer values, entry skipped
in bee_get_required_modules() (line 68 of /usr/local/bin/bee/includes/dependencies.inc).

✘ The '' module could not be enabled due to missing dependencies.

In this case I tried to enable a module that was not present in the filesystem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions