? ? Success

User tests: Successful: Unsuccessful:

avatar mgilkes
mgilkes
6 Sep 2018

Currently, the exclude attribute for the folderlist does not work. This is because the list of folders that are tested against the regular expression in exclude contains the full folder path and not the folder name only. So, instead of removing the root part after you test for the exclude, remove the root path before.

Pull Request for Issue # .

Summary of Changes

Move comment and code at lines 224-225 and place them before line 215. This will remove the root part and the leading /, so that you only test the folder name itself against the exclude regular expression.

Testing Instructions

Since there are no built-in extensions that use folder list, you can add the following field to any module's xml file to test it:

<field name="test_field" type="folderlist" default="images" label="TEST_LABEL" directory="" description="TEST_DESC" hide_none="true" hide_default="true" exclude="^[Aa]dministrator$|^[Cc]ache$|^[Cc]omponents$|^[Cc]li$|^[Ii]ncludes$|^[Ll]anguage$|^[Ll]ibraries$|^[Ll]ogs$|^[Mm]odules$|^[Pp]lugins$|^[Tt]emplates$|^[Xx]mlrpc$" />

Expected result

The drop down list should exclude the following folders: administrator, cache, components, includes, languages, cli, libraries, logs, modules, plugins, templates, xmlrpc. It should only list: bin, images, layouts, media, tmp, and any other admin created folders in the Joomla root.

Actual result

Unfortunately, it lists all the folders in the Joomla root.

Documentation Changes Required

Cut lines 224-225 and paste them at line 215. So lines 213-228 of the code will look like:

			foreach ($folders as $folder)
			{
				// Remove the root part and the leading /
				$folder = trim(str_replace($path, '', $folder), '/');

				// Check to see if the file is in the exclude mask.
				if ($this->exclude)
				{
					if (preg_match(chr(1) . $this->exclude . chr(1), $folder))
					{
						continue;
					}
				}

				$options[] = JHtml::_('select.option', $folder, $folder);
			}

avatar mgilkes mgilkes - open - 6 Sep 2018
avatar mgilkes mgilkes - change - 6 Sep 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Sep 2018
Category Libraries
avatar mgilkes mgilkes - change - 6 Sep 2018
The description was changed
avatar mgilkes mgilkes - edited - 6 Sep 2018
avatar mgilkes mgilkes - change - 6 Sep 2018
The description was changed
avatar mgilkes mgilkes - edited - 6 Sep 2018
avatar SharkyKZ SharkyKZ - test_item - 20 May 2020 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 20 May 2020

I have tested this item successfully on 8ed4f60


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

avatar infograf768 infograf768 - test_item - 20 May 2020 - Tested successfully
avatar infograf768
infograf768 - comment - 20 May 2020

I have tested this item successfully on 8ed4f60


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

avatar infograf768 infograf768 - change - 20 May 2020
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 20 May 2020

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22032.
avatar infograf768 infograf768 - change - 20 May 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-20 09:14:10
Closed_By infograf768
Labels Added: ?
avatar infograf768 infograf768 - close - 20 May 2020
avatar infograf768 infograf768 - merge - 20 May 2020
avatar infograf768
infograf768 - comment - 20 May 2020

Thanks.

Add a Comment

Login with GitHub to post a comment