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

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

Open
codepuncher opened this issue Apr 15, 2020 · 0 comments
Open

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

codepuncher opened this issue Apr 15, 2020 · 0 comments

Comments

@codepuncher
Copy link

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant