Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Can't use "Category" as a Controller #138

@codepuncher

Description

@codepuncher

Creating a Controller called Category to be used on Category archives e.g. /category/category-slug does not work.
The errors are:

Notice: Undefined index: __app in /home/lee/Code/wordpress/cleanwp/web/app/themes/sage/vendor/soberwp/controller/src/Controller.php on line 270

Warning: array_merge(): Expected parameter 1 to be an array, null given in /home/lee/Code/wordpress/cleanwp/web/app/themes/sage/vendor/soberwp/controller/src/Controller.php on line 273

Warning: array_merge(): Expected parameter 2 to be an array, null given in /home/lee/Code/wordpress/cleanwp/web/app/themes/sage/vendor/soberwp/controller/src/Controller.php on line 289

Steps to reproduce:

  1. Fresh installation of Bedrock + Sage
  2. Create an empty Controller called Category
  3. Create a Post with a Category called "Data"
  4. View the "Data" category page

This seems to be only related to the name "Data" as "Uncategorized" works fine.

Now, given that the body class is archive category category-data category-2 logged-in admin-bar app-data index-data archive-data category-2-data category-data-data customize-support I assume there is an issue with the repeated data part and how Controller works; we have category, category-data, and category-data-data.

Of course, renaming the category term from "Data" to something else solves the problem, but not in the code.

Any help appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions