Skip to content

Commit 78f7641

Browse files
Michael Babkerwilsonge
authored andcommitted
Remove registering form paths for paths that no longer exist (#21279)
1 parent a687433 commit 78f7641

File tree

3 files changed

+5
-44
lines changed

3 files changed

+5
-44
lines changed

libraries/bootstrap.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,3 @@
8282
// @deprecated 4.0
8383
JLoader::registerAlias('JAdministrator', 'JApplicationAdministrator');
8484
JLoader::registerAlias('JSite', 'JApplicationSite');
85-
86-
// Can be removed when the move of all core fields to namespace is finished
87-
\Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/joomla/form/fields');
88-
\Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/joomla/form/rule');
89-
\Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/cms/form/field');
90-
\Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/cms/form/rule');

libraries/cms.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,3 @@
8080
JLoader::register('JExtension', JPATH_PLATFORM . '/cms/installer/extension.php');
8181
JLoader::registerAlias('JAdministrator', 'JApplicationAdministrator');
8282
JLoader::registerAlias('JSite', 'JApplicationSite');
83-
84-
// Can be removed when the move of all core fields to namespace is finished
85-
\Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/joomla/form/fields');
86-
\Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/joomla/form/rule');
87-
\Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/joomla/form/rules');
88-
\Joomla\CMS\Form\FormHelper::addFormPath(JPATH_LIBRARIES . '/joomla/form/forms');
89-
\Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/cms/form/field');
90-
\Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/cms/form/rule');

libraries/src/Form/FormHelper.php

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
defined('JPATH_PLATFORM') or die;
1212

1313
use Joomla\CMS\Filesystem\Path;
14-
use Joomla\CMS\Log\Log;
15-
use Joomla\String\Inflector;
1614
use Joomla\String\Normalise;
1715
use Joomla\String\StringHelper;
1816

@@ -316,37 +314,14 @@ public static function addRulePath($new = null)
316314
*/
317315
protected static function addPath($entity, $new = null)
318316
{
319-
// Reference to an array with paths for current entity
320-
$paths = &self::$paths[$entity];
321-
322-
// Add the default entity's search path if not set.
323-
if (empty($paths))
317+
if (!isset(self::$paths[$entity]))
324318
{
325-
// While we support limited number of entities (form, field and rule) we can do simple pluralisation
326-
$entityPlural = $entity . 's';
327-
328-
// Relying on "simple" plurals is deprecated, use the properly inflected plural form
329-
$paths[] = __DIR__ . '/' . $entityPlural;
330-
331-
$inflectedPlural = Inflector::getInstance()->toPlural($entity);
332-
333-
if ($entityPlural !== $inflectedPlural)
334-
{
335-
Log::add(
336-
sprintf(
337-
'File paths for form entity type validations should be properly inflected as of 5.0.'
338-
. ' The folder for entity type "%1$s" should be renamed from "%2$s" to "%3$s".',
339-
$entity,
340-
$entityPlural,
341-
$inflectedPlural
342-
),
343-
Log::WARNING,
344-
'deprecated'
345-
);
346-
$paths[] = __DIR__ . '/' . $inflectedPlural;
347-
}
319+
self::$paths[$entity] = [];
348320
}
349321

322+
// Reference to an array with paths for current entity
323+
$paths = &self::$paths[$entity];
324+
350325
// Force the new path(s) to an array.
351326
settype($new, 'array');
352327

0 commit comments

Comments
 (0)