User tests: Successful: Unsuccessful:
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
This sets the path to the directory passed via configuration starting from the root directory.
$path = $this->directory;
$path = JPATH_ROOT . '/' . $path;
Ah looks like i have not looked close enough.
Can you please include a issue description + test instructions?
I wrote a test component called com_pr17152
com_pr17125-3.7.3.3.zip
It creates a folder called "this is the right folder" in the folder components/com_pr17125 and a folder called "this is the wrong folder" in the folder administrator/components/com_pr17125.
In the configuration page you can choose the folder using a folder list field
<field name="file_path" type="folderlist" directory="components/com_pr17125" hide_none="true" hide_default="true" recursive="false" label="folder" description=""/>
Install the component com_pr17125
Go to Components > PR# 17125 > TEST
The field should show the contents of the folder components/com_pr17125
The field shows the contents of the folder administrator/components/com_pr17125
Install the patch PR# 17125
Go to Components > PR# 17125 > TEST
Title |
|
Not in the folderlist field, otherwise we would have here a BC break. If you need that case, then I would do your own form field for the imegelist custom field.
Why we have a BC break can be reproduced with the following steps:
<field name="file_path" type="folderlist" directory="help" hide_none="true" hide_default="true" recursive="false" label="Help" description=""/>
I'm not be able to change the code. I lost the branch.
This code should solve the BC break
if (!is_dir($path) || is_dir(JPATH_ROOT . '/' . $path))
{
$path = JPATH_ROOT . '/' . $path;
}
By removing is_dir($path) the behavior will change slightly but the function still works
if (is_dir(JPATH_ROOT . '/' . $path))
{
$path = JPATH_ROOT . '/' . $path;
}
If the path doesn't exist, in the first case the error is related to JPATH_ROOT . '/' . $path, as it is now;
in the second one, the error is related to $path
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-05-04 07:35:20 |
Closed_By | ⇒ | eshiol |
This would always set the path to the root and not respect the configruation.