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

Undefined variable in override file intro_image.php #371

Open
mojeweb opened this issue Nov 3, 2023 · 1 comment
Open

Undefined variable in override file intro_image.php #371

mojeweb opened this issue Nov 3, 2023 · 1 comment

Comments

@mojeweb
Copy link

mojeweb commented Nov 3, 2023

Steps to reproduce the issue

In HU 2.0.17 open article.

Expected result

Article opens with no errors.

Actual result

I get PHP notice: Undefined variable: JoomlaVersion in /plugins/system/helixultimate/overrides/layouts/joomla/content/intro_image.php on line 90

And with local server I get Forbidden You don't have permission to access /blog/article-alias on this server.

If I add this code to file intro_image.php, all is ok:
// Define the variable $JoomlaVersion $version = new Version(); $JoomlaVersion = $version->getShortVersion();

System information (as much as possible)

J 4.4.0
HU 2.0.17
PHP 7.4.2

Additional comments

No problem with casiopea.

@mojeweb
Copy link
Author

mojeweb commented Nov 3, 2023

I see that in your original code, $JoomlaVersion is defined within a conditional block (line 57), specifically inside an if statement. If the if condition is not met, the variable may not be defined, which can lead to the "Undefined variable: JoomlaVersion" notice if you try to use it later.

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

No branches or pull requests

1 participant