User tests: Successful: Unsuccessful:
Category | ⇒ | Modules Administration |
Status | New | ⇒ | Pending |
Title |
|
I have tested this item
See #18134
@infograf768 anyway not in that way #18134
Suggested a solution there.
// Exclude item if com_fields component is not installed or disabled
if ($item->element == 'com_fields' && (!JComponentHelper::isInstalled($item->element) || !JComponentHelper::isEnabled($item->element)))
{
continue;
}
Labels |
Added:
?
|
only for com_fields
sound more reasonable
I have tested this item
Yep. :)
#18134 (comment). Do we really want to show other components link if they are not installed or disabled?
I tested with other components without issues. com_fields is very specific.
tested further.
if ($item->element && !JComponentHelper::isEnabled($item->element))
is not the one adding queries
it is
!JComponentHelper::isInstalled($item->element)
which is the culprit.
Basically only a component which does not exist in the _extensions table but still has entries in the _menu table would be concerned.
FYI JComponentHelper::isInstalled
is never used in core.
@infograf768 As I can see \Joomla\CMS\Component\ComponentHelper::isInstalled
return the count of records matching the component name passed. I wonder whether it is possible that the value is anything other than 0
or 1
?
If not then IMHO, we can simply proxy this method to isEnabled
and deprecated this for J4.
If not then IMHO, we can simply proxy this method to isEnabled and deprecated this for J4.
I would not do that as it would not be B/C in case a 3rd party is using the method.
But in our case here, I just would not use it at all and change this PR to use only
if ($item->element && !JComponentHelper::isEnabled($item->element))
@mbabker
What do you think?
I just would not use it at all and change this PR to use only ...
Fair enough for me.
if isEnabled() =yes/no
i will assume that isInstalled() = true
if isEnabled() =yes/no i will assume that isInstalled()
Yep. Can you modify PR?
@infograf768 so no more exception for com_fields
?
no need as you can test
You still need imho to add
if ($item->element
please double check cause i'm unable to test it right now
I have tested this item
As I can see \Joomla\CMS\Component\ComponentHelper::isInstalled return the count of records matching the component name passed. I wonder whether it is possible that the value is anything other than 0 or 1?
The method should only return 0 or 1. If it doesn't, then someone has a corrupt database because you can't install two extensions with the same component name.
@infograf768 @mbabker @alikon Please also see #18308.
PS: This PR is still applicable. My PR does not replace it.
@izharaazmi
Please nevertheless set this one to test OK
I have tested this item
Milestone |
Added: |
||
Status | Pending | ⇒ | Ready to Commit |
RTC. Thanks.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-15 15:52:16 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
I have tested this item✅ successfully on eebc59c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18264.