No Code Attached Yet bug
avatar korenevskiy
korenevskiy
17 Oct 2025

Steps to reproduce the issue

  1. specify it in the file .htaccess
    php_value open_basedir '/home/user/Joomla6/public_html/:/tmp/'
  2. Turn on the development mode and turn on the display of all errors.
  3. Creating an article field with the imagelist type
  4. Open article with it field and show:
Warning
: is_dir(): open_basedir restriction in effect. File(/images//) is not within the allowed path(s): (home/user/Joomla6/public_htm/:/tmp/) in
/home/user/Joomla6/public_htm/libraries/src/Form/Field/FilelistField.php
on line
194

in code

$path = $this->directory;
if (!is_dir($path)) {
$path = JPATH_ROOT . '/' . $path;
}

Since the CMS parent directory is not specified in the $path field, it returns an error.

The important thing is that I did not specify the directory path anywhere. The default path is set in the plugin and in the field.

System information (as much as possible)

php 8.3.25

Additional comments - Idea

I suggest inserting a dog sign (@) before the is_dir() functions.

        if (! @is_dir($path)) {
            $path = JPATH_ROOT . '/' . $path;
        }
avatar korenevskiy korenevskiy - open - 17 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Oct 2025
avatar korenevskiy korenevskiy - change - 17 Oct 2025
The description was changed
avatar korenevskiy korenevskiy - edited - 17 Oct 2025
avatar korenevskiy korenevskiy - change - 17 Oct 2025
The description was changed
avatar korenevskiy korenevskiy - edited - 17 Oct 2025
avatar korenevskiy korenevskiy - change - 17 Oct 2025
The description was changed
avatar korenevskiy korenevskiy - edited - 17 Oct 2025
avatar korenevskiy korenevskiy - change - 17 Oct 2025
The description was changed
avatar korenevskiy korenevskiy - edited - 17 Oct 2025
avatar korenevskiy korenevskiy - change - 18 Oct 2025
The description was changed
avatar korenevskiy korenevskiy - edited - 18 Oct 2025
avatar Fedik
Fedik - comment - 18 Oct 2025

I suspect you use FilelistField incorrectly.
Please post here the XML you use for the field.

avatar korenevskiy
korenevskiy - comment - 19 Oct 2025

The XML file has nothing to do with it.
I use the article fields.
I have created fields in the fields component.
And then I opened the articles editor. The user fields tab displays this error.

avatar Fedik
Fedik - comment - 20 Oct 2025

So it is bug in custom field. It have to use relative path without leading slash

$fieldNode->setAttribute('directory', '/images/' . $fieldNode->getAttribute('directory'));


<option value="/">/</option>

avatar Fedik Fedik - change - 20 Oct 2025
Labels Added: bug
avatar Fedik Fedik - labeled - 20 Oct 2025
avatar Fedik Fedik - change - 20 Oct 2025
Title
[6.0] Error Backend with show imagelist field
[6.0] Error with imagelist Custom Field: is_dir(): open_basedir restriction in effect
avatar Fedik Fedik - edited - 20 Oct 2025
avatar korenevskiy
korenevskiy - comment - 21 Oct 2025

@Fedik Please help me if I can't create a layout override for this IMAGELIST field.
I copied and renamed the layout file, but it does not appear in the layout list field.
/plugins/fields/imagelist/tmpl/imagelist.php
to
/plugins/fields/imagelist/tmpl/images.php
but it doesn't file appear in the field in the layout list.

avatar Fedik
Fedik - comment - 21 Oct 2025

I do not think it will work like that,
The override should be under template in its html folder:
templateName/html/plg_fields_imagelist/imagelist.php
Or something like that.

avatar korenevskiy
korenevskiy - comment - 22 Oct 2025

No, it doesn't work.
I opened the default Cassiopeia template.
In the settings, I created a redefinition of the plug-in layout plg_fields_imagelist
I checked the availability of the layout at
templates/cassiopeia/html/plg_fields_imagelist/imagelist.php
And created a copy
templates/cassiopeia/html/plg_fields_imagelist/pictures.php
There is still 1 default layout in the field layout list.
I use Cassiopeia by default. I also used CMS resources to create the layout. Unfortunately, it does not appear in the list.
I thought I didn't know much, but I did as you said.

avatar brianteeman
brianteeman - comment - 22 Oct 2025

I can confirm that the layout field in the field settings does not display that you have an override in the template
I can also confirm that changes in override in the templates/cassiopeia/html/plg_fields_imagelist/imagelist.php file are used when the field is displayed. NOTE: this is the display of the field output and NOT the display of the field input

avatar korenevskiy
korenevskiy - comment - 22 Oct 2025

But why is there a layout list field in the field parameters, because there is no information in this list? And from the point of view of the content administrator, there is confusion and misunderstanding.
That's exactly how I felt, I didn't understand what this list was for if there was no information and no choice either.
If this parameter is very important, then it can be hidden.

avatar brianteeman
brianteeman - comment - 22 Oct 2025

I would suggest it's a bug

avatar korenevskiy
korenevskiy - comment - 22 Oct 2025

Should me create a new issue?

avatar brianteeman
brianteeman - comment - 23 Oct 2025

yes please

avatar Fedik
Fedik - comment - 23 Oct 2025

No.
There a few levels of "field layouts".
What you see in field params, is looking for layout in /html/layouts/...

$template_paths = [
Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/' . $extension . '/field'),
Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/com_fields/field'),
Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/field'),
];

Create my-imagelist.php in one of these folder, and you should be able to pick it in the field configuration.

This layout is used for rendering the field value after it was rendered with tmpl layout of the plugin.
To override layout from tmpl use my previous comment.

avatar brianteeman
brianteeman - comment - 23 Oct 2025

@Fedik The paths are wrong - this is a BUG!!!!

The override is created in templates\cassiopeia\html\plg_fields_imagelist

That path is NOT in the array so the layout field will never list the overrides

avatar Fedik
Fedik - comment - 23 Oct 2025

@brianteeman Sorry maybe my comment was not clear.
There is 2 layout systems working here:

  • tmpl/ which render the field value ("plugin level" override),
  • layouts/ which you can select in the field drop-down. This is kind of wrapper around the value which was already rendered by tmpl/

Do not ask why.
I agree it is very confusing, but it is what it is.

avatar brianteeman
brianteeman - comment - 23 Oct 2025

You are missing the important part. When you create an override in the template manager it is created in a folder in a path NOT include in the list of paths. That is the BUG. Either fix the creation of the override so it is in an included path or fix the array of paths to include the correct path. Use joomla instead of reading the code to see the problem!!

avatar Fedik
Fedik - comment - 23 Oct 2025

Please check my comment again.
It is how it coded to work. There no way to connect these 2 override system in to ONE drop down. They serve for different purpose.

Look in Module system for example. There tmpl/ for rendering the module and the chrome layout to render result.
It kind of the same.

You can open an issue if you like.
But it is not a bug in the code because it works as it should. But limited documentation.
The documentation is very generic, and do not explain what exactly it is.
The layout field does not have any description.

avatar Fedik
Fedik - comment - 23 Oct 2025

Later I will hide all unrelated comments here.

avatar brianteeman
brianteeman - comment - 23 Oct 2025

Sorry you are wrong. Use the template manager to create an override. Edit it and check to confirm that it is used. That override should be displayed in the layouts drop-down just like all overrides. The code doesn't do that and that is the bug.

avatar Fedik
Fedik - comment - 23 Oct 2025

Use the template manager to create an override. Edit it and check to confirm that it is used

What exactly is used html/plg_fields_imagelist/imagelist.php or html/plg_fields_imagelist/foobar.php?

html/plg_fields_imagelist/imagelist.php will be used because it is tmpl/ override. But no, it should not be in existing drop-down. Existing layout field is for D I F F E R E N T purpose.

There no field for selecting layout for tmpl/ override. If you need such field then it will separated field, because it is DIFFERENT.

avatar brianteeman
brianteeman - comment - 23 Oct 2025

i am obviously using a different joomla to you

avatar Fedik
Fedik - comment - 23 Oct 2025

No, I understand what you doing. But you seem did not understand that there are TWO layout systems involved, and they not interchangeable.

Create file templates/cassiopeia/html/layouts/com_fields/field/foobar.php. And it will be available in that layout dropdown.

avatar korenevskiy
korenevskiy - comment - 23 Oct 2025

But then there's a mistake.
The template parameters override the layout at
/templates/cassiopeia/html/plg_fields_imagelist
but to display it in the layout list, you need an address.
/templates/cassiopeia/html/layouts/plg_fields_imagelist/field

I'm not arguing that the layout file should be located elsewhere. I don't have to create the file myself through the file manager. The template has an override function. The override function tells us that by overriding the layout with the built-in CMS functions, it should have been included in the layout list. This means that automatic redefinition is not being done in the right way.
Either the layout display list is not working, or the automatic layout override function is not working.

Image
avatar korenevskiy
korenevskiy - comment - 23 Oct 2025

No.
There a few levels of "field layouts".
What you see in field params, is looking for layout in /html/layouts/...

I'm sorry, I didn't figure it out, but there is an assumption that your code example is a redefinition of layouts not of user fields, but a redefinition of input fields.

 $template_paths = [ 
     Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/' . $extension . '/field'), 
     Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/com_fields/field'), 
     Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/field'), 
 ];

It's very similar to redefining input fields.
I was asking about redefining plugin fields.

But in this case, if these overrides are displayed in the layout list, the strange thing is that the automatic override in the template parameters does not create an override at the correct address.

avatar korenevskiy
korenevskiy - comment - 23 Oct 2025

#46361

Colleagues, I have created a new ISSUE, let's deal with the error there. and here we will remove the excess

avatar Fedik
Fedik - comment - 24 Oct 2025

I hid unrelated comments.

Add a Comment

Login with GitHub to post a comment