For a component, if anyone creates Extension/CompnameComponent.php
file and inside this class, the boot()
function does not register anything.
If I register something like
$this->getRegistry()->register('testregistry', new AdministratorService);
and call this like
HTMLHelper::_('testregistry.func', $arg1, $arg2)
this returns 500 JHtml testregistry not found.
If I place a die()
inside the boot()
function this is expected to die the site but it renders the site.
The boot()
method not working.
Labels |
Added:
?
|
Title |
|
Labels |
Added:
J4 Issue
|
Title |
|
Title |
|
Status | New | ⇒ | Information Required |
anyone?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-03 19:19:31 |
Closed_By | ⇒ | alikon |
Closing this due to not receiving required information to determine if this is a bug or not. If you feel this still needs review, please open a new tracker entry with as much information as possible to ensure it can be reviewed properly
Status | Closed | ⇒ | New |
Closed_Date | 2020-02-03 19:19:31 | ⇒ | |
Closed_By | alikon | ⇒ |
This is a case where a reproducer is needed. Since the original issue report says that the component class' boot()
method isn't being called, it could very well be there is something misconfigured about the component or there could be some edge case being run into that the code isn't handling. This one is legitimately something to put a "if no response after X then close" condition on, but usually it's better to say "we will close this in 2 weeks if we don't get anymore information about this issue" than to just blindly come in and close something that has had no action for months on end.
It looks indeed like that something with the registration is not correct. The content component registers services in the component class as well which works. Otherwise the back end articles list would crash. Here is the line with the registration:
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/src/Extension/ContentComponent.php#L106
Did you register the component in the service class like here https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/services/provider.php#L53 ?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-12 08:39:22 |
Closed_By | ⇒ | joomdonation | |
Labels |
Added:
No Code Attached Yet
Removed: ? |
We use this in our core components like com_content, com_contact.... and it is working well. So I would say that the problem comes from the code of the custom component. After 3 years, many things have changed, and we do not receive any further feedback, so I'm closing this issue. If you still have issue, look at the comment above from @laoneo for instructions and ask us further if needed.
@infograf768 can you please comment?