RTC bug Small PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar costafrancesco94
costafrancesco94
14 Jan 2022

Pull Request for Issue #36669 .

Summary of Changes

Remove JPATH_ROOT from absolute file path only if JPATH_ROOT is at beginning of string

Testing Instructions

Added by rdeutz

  • Find out the root path of your installation e.g /var/www/joomla
  • create a directory /var/www/joomla/media/templates/site/cassiopeia/images/var/www/joomla and copy an image file into the directory e.g. myimage.png
  • go into the template index.php
  • add echo HTMLHelper::_('image', 'var/www/joomla/myimage.png', 'theImage', [], true,0);

Actual result BEFORE applying this Pull Request

If JPATH_ROOT is repeated inside file names, resources are not getting loaded.

Example:
JPATH_ROOT = '/joomla'
$path = '/joomla/media/system/images/joomla-favicon.svg'
Wrong output before: /media/system/images-favicon.svg

Another less unusual example:
JPATH_ROOT = '/app/html
$path = '/app/html/media/com_something/js/app/html_custom.js'
Wrong output before: /media/com_something/js_custom.js

Expected result AFTER applying this Pull Request

If JPATH_ROOT is present 2 times in the $path, it will be removed only if at beginning (where it should be)

Example:
JPATH_ROOT = '/joomla'
$path = '/joomla/media/system/images/joomla-favicon.svg'
Correct output with patch: /media/system/images/joomla-favicon.svg

Another less unusual example:
JPATH_ROOT = '/app/html
$path = '/app/html/media/com_something/js/app/html_custom.js'
Wrong output before: /media/com_something/js/app/html_custom.js

Documentation Changes Required

Problem was not declared anywhere else

Code run as before (JPATH_ROOT is not supposed to be in the middle of the $path if not for casuality)

avatar costafrancesco94 costafrancesco94 - open - 14 Jan 2022
avatar costafrancesco94 costafrancesco94 - change - 14 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jan 2022
Category Libraries
avatar costafrancesco94 costafrancesco94 - change - 14 Jan 2022
Labels Added: ?
avatar HLeithner
HLeithner - comment - 27 Jun 2022

This pull request has automatically rebased to 4.2-dev.

avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar HLeithner HLeithner - change - 27 Jun 2022
Labels Added: ? ?
Removed: ?
avatar Hackwar Hackwar - change - 21 Oct 2022
Labels Added: ?
Removed: ?
avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 4.3-dev.

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 4.4-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
fix joomla/joomla-cms#36669
[4.4] fix joomla/joomla-cms#36669
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 15 Nov 2024
Title
[4.4] fix joomla/joomla-cms#36669
[5.2] fix joomla/joomla-cms#36669
avatar HLeithner HLeithner - edited - 15 Nov 2024
avatar Hackwar Hackwar - change - 16 Jan 2025
Labels Added: PBF bug Small PR-4.4-dev PR-5.2-dev
Removed: ? ?
avatar Hackwar Hackwar - change - 17 Jan 2025
Labels Removed: PR-4.4-dev
avatar richard67 richard67 - change - 19 Jan 2025
Labels Added: Updates Requested
avatar rdeutz rdeutz - change - 19 Jan 2025
Title
[5.2] fix joomla/joomla-cms#36669
[5.2] Remove root path only if it is at the beginning
avatar rdeutz rdeutz - edited - 19 Jan 2025
avatar rdeutz rdeutz - change - 19 Jan 2025
The description was changed
avatar rdeutz rdeutz - edited - 19 Jan 2025
avatar rdeutz
rdeutz - comment - 19 Jan 2025

Added testing instructions and tested successfully

avatar rdeutz rdeutz - test_item - 19 Jan 2025 - Tested successfully
avatar rdeutz
rdeutz - comment - 19 Jan 2025

I have tested this item ✅ successfully on d47f76c


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

avatar richard67 richard67 - change - 19 Jan 2025
The description was changed
avatar richard67 richard67 - edited - 19 Jan 2025
avatar joomdonation joomdonation - test_item - 19 Jan 2025 - Tested successfully
avatar joomdonation
joomdonation - comment - 19 Jan 2025

I have tested this item ✅ successfully on d47f76c

On windows, it's hard to follow the instructions. But I reviewed code, also tried to using media manager, navigate to different pages and do not see any error.


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

avatar joomdonation joomdonation - change - 19 Jan 2025
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 19 Jan 2025

RTC. Thanks.


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

avatar LadySolveig LadySolveig - change - 19 Jan 2025
Labels Added: RTC
Removed: Updates Requested PBF
avatar LadySolveig LadySolveig - close - 19 Jan 2025
avatar LadySolveig LadySolveig - merge - 19 Jan 2025
avatar LadySolveig LadySolveig - change - 19 Jan 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-01-19 11:33:05
Closed_By LadySolveig

Add a Comment

Login with GitHub to post a comment