? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
17 Mar 2021

Pull Request for Issue Closes #31989

Summary of Changes

Prepend templatePath with Uri:root to Ensure templatePath is always absolute and not a broken relative url

Testing Instructions

See #31989

Visit frontend , click a menu link in the left menu to get to an article
Note that the CASSIOPEIA logo (white text on blue background) is present

In Joomla Admin disable the "System - SEF" plugin

Refresh your article page on the frontend

Note the logo is now a broken image

Actual result BEFORE applying this Pull Request

paths are relative, and therefore image doesn't display when non-SEF mode and not at / (ie. in a sub folder or not on the home page where url contains /index.php/path/to like http://127.0.0.1:4444/index.php/component/users/reset?Itemid=101)

Expected result AFTER applying this Pull Request

regardless of SEF plugin status, the image and assets loaded from $templatePath load correctly.

Documentation Changes Required

none

avatar PhilETaylor PhilETaylor - open - 17 Mar 2021
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Mar 2021
Category ⇒ Front End Templates (site)
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Title
…
Ensure templatePath is always absolute and not a broken relative url
[4.0] Ensure templatePath is always absolute and not a broken relative url
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor
PhilETaylor - comment - 17 Mar 2021

@SharkyKZ instead of a down thumb would you care to explain why you are not happy with this pull request?

avatar joomdonation
joomdonation - comment - 20 Mar 2021

@PhilETaylor Maybe better fix would be change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/templates/cassiopeia/index.php#L77 to:

$logo = '<img src="' . Uri::root(true) . '/' . $templatePath . '/images/logo.svg" class="logo d-inline-block" alt="' . $sitename . '">';

That would fix the link to the logo without making other links become absolute.

avatar PhilETaylor
PhilETaylor - comment - 20 Mar 2021

Tell me what is so wrong with absolute links.

Have you tests with joomla installed in sub folders?

On 20 Mar 2021, at 14:39, Tuan Pham Ngoc @.***> wrote:


@PhilETaylor Maybe better fix would be change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/templates/cassiopeia/index.php#L77 to:

$logo = '' . $sitename . '';
That would fix the link to the logo without making other links become absolute.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

avatar joomdonation
joomdonation - comment - 20 Mar 2021

Yes, I always use Joomla in sub-folder.

avatar joomdonation
joomdonation - comment - 20 Mar 2021

For what's wrong with absolute urls, honestly, I'm unsure. But all the other links if you view sources are relative, not absolute. I remember that I read somewhere that absolute urls will make resources load slower (but I don't know if that's right or wrong)

avatar toivo toivo - test_item - 23 Mar 2021 - Tested successfully
avatar toivo
toivo - comment - 23 Mar 2021

I have tested this item ✅ successfully on 5023776

Tested successfully in Beta8-dev of 22 March using Wampserver 3.2.4 and PHP 8.0.2.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32714.

avatar PhilETaylor PhilETaylor - change - 23 Mar 2021
Status Pending ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2021-03-23 11:36:37
Closed_By ⇒ PhilETaylor
Labels Added: ?
avatar PhilETaylor PhilETaylor - close - 23 Mar 2021
avatar PhilETaylor
PhilETaylor - comment - 23 Mar 2021

Replaced with #32822

Add a Comment

Login with GitHub to post a comment