Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Unifying InstallAdapter::getElement() #40608

Draft
wants to merge 5 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented May 16, 2023

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:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@Hackwar Hackwar marked this pull request as draft May 16, 2023 15:05
@richard67
Copy link
Member

@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

@HLeithner
Copy link
Member

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

@Hackwar Hackwar closed this Mar 22, 2024
@Hackwar Hackwar deleted the 5.0-installer-element branch March 22, 2024 10:49
@Hackwar Hackwar restored the 5.0-installer-element branch March 22, 2024 10:52
@Hackwar Hackwar reopened this Mar 22, 2024
@Quy Quy removed the PR-5.0-dev label Mar 23, 2024
@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:08
@HLeithner
Copy link
Member

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

@HLeithner HLeithner changed the title [5.0] Unifying InstallAdapter::getElement() [5.2] Unifying InstallAdapter::getElement() Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants