When you have a template disabled (e.g. beez3) although the template doesn't appear in Extensions -> Templates -> Styles, it appears in Extensions -> Templates -> Templates.
To solve this issue, this simple PR adds a additional where to the com_templatestemplates model query.
Testing Instructions
Fast test
Experience developer can check code difference.
Normal test
Use 3.5.0 or latest staging
Go to Extensions -> Manage -> Manage, filter by Type = Template and disable beez3 and hathor.
Now go to Extensions -> Templates -> Styles and check that hathor and beez3 are not there.
Now go to Extensions -> Templates -> Templates and check that hathor and beez3 ARE there.
Apply this patch
Repeat steps 2 to 4 and check that hathor and beez3 ARE NOT there.
I have tested this item successfully on 3b694f0
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9723.