joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.3] Unifying InstallAdapter::getElement()

Open Hackwar opened this issue 2 years ago • 4 comments

Summary of Changes

Our different extension types all have different ways how to find out their own name. A component, language and template could be named after a tag in its manifest or by its name. A module will either use the tag or read the first module attribute to a child of the tag it can find. A file extension will always be named after its manifests filename, a plugin will require you to do the same as for modules, but does not support the tag. Packages expect an element named "packagename", but which is not allowed to contain a pkg_ prefix. Libraries need an element named . Only half of that is documented here: https://docs.joomla.org/Manifest_files

This PR unifies that so that all extensions (except file) support the element tag and, if not present, will fall back to the name. All current behavior is kept and will take precedence over this "new" behavior. All output now is also run through the InputFilter::clean() method.

Testing Instructions

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • [X] Documentation link for docs.joomla.org:

  • [ ] No documentation changes for docs.joomla.org needed

  • [X] Pull Request link for manual.joomla.org:

  • [ ] No documentation changes for manual.joomla.org needed

Hackwar avatar May 16 '23 14:05 Hackwar

@Hackwar Unit tests are failing, see https://ci.joomla.org/joomla/joomla-cms/65798/1/10 :

There were 3 failures:

1) Joomla\Tests\Unit\Libraries\Cms\Installer\Adapter\ModuleAdapterTest::testgetElement1
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'somethingElse'
+'mod_somethingelse'

/drone/src/tests/Unit/Libraries/Cms/Installer/Adapter/ModuleAdapterTest.php:82

2) Joomla\Tests\Unit\Libraries\Cms\Installer\Adapter\ModuleAdapterTest::testgetElement2
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'somethingElse'
+'mod_somethingelse'

/drone/src/tests/Unit/Libraries/Cms/Installer/Adapter/ModuleAdapterTest.php:100

3) Joomla\Tests\Unit\Libraries\Cms\Installer\Adapter\ModuleAdapterTest::testgetElementFromElementTag
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'somethingElse'
+'mod_somethingelse'

/drone/src/tests/Unit/Libraries/Cms/Installer/Adapter/ModuleAdapterTest.php:123

richard67 avatar May 17 '23 14:05 richard67

This pull request has been automatically rebased to 5.1-dev.

HLeithner avatar Sep 30 '23 22:09 HLeithner

This pull request has been automatically rebased to 5.2-dev.

HLeithner avatar Apr 24 '24 09:04 HLeithner

This pull request has been automatically rebased to 5.3-dev.

HLeithner avatar Sep 02 '24 08:09 HLeithner

This pull request has been automatically rebased to 6.0-dev.

HLeithner avatar Mar 04 '25 17:03 HLeithner

Please provide test instructions

brianteeman avatar Apr 11 '25 10:04 brianteeman

This pull request has been automatically rebased to 6.1-dev.

HLeithner avatar Aug 31 '25 12:08 HLeithner