No Code Attached Yet bug
avatar SniperSister
SniperSister
15 Apr 2026

What happened?

Webservice endpoints return a broken response with enabled debug mode, as the debug bar is unable to fetch the current template name due to changes in #46551

Image

Version

6.1

Expected result

Proper JSON markup returned

Actual result

JSON and error returned

System Information

No response

Additional Comments

No response

avatar SniperSister SniperSister - open - 15 Apr 2026
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2026
Labels Added: No Code Attached Yet bug
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Apr 2026
avatar Fedik
Fedik - comment - 15 Apr 2026

The problem that JPATH_THEMES is pointing to non existing /api/templates/

protected function isValidTemplate($template): bool
{
if (!empty($template->template) && is_file(JPATH_THEMES . '/' . $template->template . '/index.php')) {
return true;
}
if (!empty($template->parent) && is_file(JPATH_THEMES . '/' . $template->parent . '/index.php')) {
return true;
}

I not sure what is right solution would be.
There few more related issues to missing template under Api/Cli applications

avatar alikon
alikon - comment - 17 Apr 2026

with debug plugin disabled endpoints responds

avatar alikon
alikon - comment - 17 Apr 2026
avatar joomdonation
joomdonation - comment - 20 Apr 2026

Sorry, I missed this issue. Looking at the code again, I think there are two options:

  • override getTemplate method for ApiApplication and remove the isValidTemplate check in that method
  • Or override isValidTemplate, always return true

I do not know which one is better, maybe override getTemplate makes more sense. @SniperSister @Fedik How do you think about it or have a better idea?

avatar SniperSister
SniperSister - comment - 20 Apr 2026

I do not know which one is better, maybe override getTemplate makes more sense

Makes sense for me, the ApiApplication will have a valid, custom template anyways

avatar Fedik
Fedik - comment - 20 Apr 2026

We can do that, ignore the validation for api.
Or maybe just check api application for site template.

The reason is that people still may render something for api that uses the template.
But not sure how to do that.

For now maybe just override isValid

avatar joomdonation
joomdonation - comment - 21 Apr 2026

Thanks for your both suggestions. Currently, we do not actually use template in API application, so I think having isValidTemplate directly in APIApplication is not really logical. So I decided to override getTemplate method instead in PR #47646

Add a Comment

Login with GitHub to post a comment