controller
controller copied to clipboard
Can't use "Category" as a Controller
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:
- Fresh installation of Bedrock + Sage
- Create an empty Controller called
Category
- Create a Post with a Category called "Data"
- 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!