Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong autoload template registry file path in Web Asset Registry #44178

Open
pinta83 opened this issue Oct 2, 2024 · 1 comment
Open

Wrong autoload template registry file path in Web Asset Registry #44178

pinta83 opened this issue Oct 2, 2024 · 1 comment

Comments

@pinta83
Copy link
Contributor

pinta83 commented Oct 2, 2024

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
Copy link
Contributor Author

pinta83 commented Oct 2, 2024

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

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

No branches or pull requests

2 participants