|
11 | 11 | defined('JPATH_PLATFORM') or die; |
12 | 12 |
|
13 | 13 | use Joomla\CMS\Filesystem\Path; |
14 | | -use Joomla\CMS\Log\Log; |
15 | | -use Joomla\String\Inflector; |
16 | 14 | use Joomla\String\Normalise; |
17 | 15 | use Joomla\String\StringHelper; |
18 | 16 |
|
@@ -316,37 +314,14 @@ public static function addRulePath($new = null) |
316 | 314 | */ |
317 | 315 | protected static function addPath($entity, $new = null) |
318 | 316 | { |
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])) |
324 | 318 | { |
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] = []; |
348 | 320 | } |
349 | 321 |
|
| 322 | + // Reference to an array with paths for current entity |
| 323 | + $paths = &self::$paths[$entity]; |
| 324 | + |
350 | 325 | // Force the new path(s) to an array. |
351 | 326 | settype($new, 'array'); |
352 | 327 |
|
|
0 commit comments