joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Wrong autoload template registry file path in Web Asset Registry

Open pinta83 opened this issue 1 year ago • 4 comments

Steps to reproduce the issue

Change "administrator" folder in "/includes/defines.php" and "/administrator/includes/defines.php" to "admin" rename "administrator" folder to "admin"

Expected result

Everything working

Actual result

Error 500 - There is no "template.atum.ltr" asset of a "preset" type in the registry.

System information (as much as possible)

Joomla 5.x

Additional comments

Change "addTemplateRegistryFile" function in /libraries/src/WebAsset/WebAssetRegistry.php to:

    /**
     * Helper method to register new file with Template Asset(s) info
     *
     * @param   string   $template  The template name
     * @param   integer  $client    The application client id
     *
     * @return  self
     *
     * @since  4.0.0
     */
    public function addTemplateRegistryFile(string $template, int $client): self
    {
        switch ($client) {
            case 0:
            case 1:
                $this->addRegistryFile(str_replace(JPATH_ROOT . '/', '', JPATH_THEMES) . '/' . $template . '/joomla.asset.json');
                break;
            default:
                break;
        }

        return $this;
    }

pinta83 avatar Oct 02 '24 07:10 pinta83

Fix for issue... Rename to php WebAssetRegistry.txt

pinta83 avatar Oct 02 '24 07:10 pinta83

@pinta83 If the issue is fixed it should be closed.

ghost avatar Oct 09 '24 09:10 ghost

It's not fixed, I only offered a solution. Still needs to be implemented / merged with Joomla... I tried to do a pull request, but sadly I can't - since I'm not a contributor (anymore).

pinta83 avatar Oct 09 '24 09:10 pinta83

I tried to do a pull request, but sadly I can't - since I'm not a contributor (anymore).

Anyone can make a pull request https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

brianteeman avatar Oct 09 '24 10:10 brianteeman

@Fedik Could you please look at this when you have a moment? Thanks.

joomdonation avatar Feb 22 '25 09:02 joomdonation

Please test https://github.com/joomla/joomla-cms/pull/44980

Fedik avatar Feb 23 '25 09:02 Fedik