No Code Attached Yet bug
avatar JProof
JProof
10 Nov 2021

Steps to reproduce the issue

During component-development directly in joomla

  • Remove from a installable component in the <administration> </administration>
  • Install the component by "discover"
  • After discover the following screen
    img-2021-11-10-20-38-26

Expected result

Not installed should really not installed

Actual result

The Component was installed/discovered into the Database
img-2021-11-10-20-40-28

The Problem is, that the component namespace does not work because component is HALF installed

System information (as much as possible)

Joomla! 4.0.4
every system

Additional comments

Breaks here:

img-2021-11-10-20-46-48

After Breaking final installation tasks will not finished. So the the component-namespace was not "registered" somewhere

img-2021-11-10-20-47-17

EDIT:
In addition: is it possible or better for development during discover to re-create / handle the namespace-cache generation with the PlgExtensionNamespacemap???

avatar JProof JProof - open - 10 Nov 2021
avatar joomla-cms-bot joomla-cms-bot - change - 10 Nov 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Nov 2021
avatar JProof JProof - change - 10 Nov 2021
The description was changed
avatar JProof JProof - edited - 10 Nov 2021
avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021
avatar alikon alikon - close - 11 Nov 2021
avatar alikon
alikon - comment - 11 Nov 2021

funny

Sad panda

avatar alikon alikon - change - 11 Nov 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-11-11 19:51:38
Closed_By alikon
avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

@alikon I think that the check for the administrator in the manifest should be done much earlier and bail out without doing anything more (now it copies files, etc). So, I guess this is still a valid issue

avatar JProof
JProof - comment - 11 Nov 2021

Okay!

By the way, the <administrator><menu>... also never works on discover, perhaps that is the right time to change this "ugly" behaviours?

avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

perhaps that is the right time to change this "ugly" behaviours?

You're welcome to contribute some code

avatar alikon alikon - change - 11 Nov 2021
Status Closed New
Closed_Date 2021-11-11 19:51:38
Closed_By alikon
avatar alikon alikon - reopen - 11 Nov 2021
avatar alikon
alikon - comment - 11 Nov 2021

yes for sure, @JProof please submit a pr

i've always thinked that
<administration> </administration>

was mandatory

anyway happy to be wrong ?

avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

i've always thinked that <administration> </administration> was mandatory

That's right, it is mandatory. That said if it's missing it shouldn't produce half installed components

There's a PR that changes the order of execution so the installer will bail out without writting any files: #36014

avatar JProof
JProof - comment - 11 Nov 2021

will look at the weekend for the following "issues"

  • this issue
  • the <administration><menu (f**ks me of since a couple of years xD) reinstall the admin component menu items(if changed)
  • and the <namespace in manifest

Goal is develop directly in joomla fast/simple components and "discover" that the component is working.

cu

avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

@JProof you could test #36014. It doesn't solve all the issues but at least won't produce the current mess (I hope)

avatar JProof
JProof - comment - 11 Nov 2021

@dgrammatiko yes ..thanks. will look for it over the weekend.

avatar JProof
JProof - comment - 11 Nov 2021

@dgrammatiko as the <administration> is mandatory, why we throw the RuntimeException?
That makes no sense for me.

// Make sure that we have an admin element
		if (!$this->getManifest()->administration)
		{
			throw new \RuntimeException(Text::_('JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT'));
		}
avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

as the is mandatory, why we throw the RuntimeException?

I guess it was supposed to be a fail-safe switch but it ran too late, the conditional should be an indication if the installation should proceed or not. The trhowable it's more to do with the parent code (the try/catch part)

avatar JProof
JProof - comment - 11 Nov 2021

Okay, thank you!
last question for the moment i hope

https://github.com/joomla/joomla-cms/tree/4.0-dev/tests/Unit/Libraries/Cms/Installer/Adapter
There is no unit.test for the ComponentAdapter? or i am in wrong location?

avatar dgrammatiko
dgrammatiko - comment - 11 Nov 2021

There is no unit.test for the ComponentAdapter? or i am in wrong location?

You're right, no unit tests

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment