User tests: Successful: Unsuccessful:
Pull Request for Issue #13783.
Replaces #13788 and #13787
Adding client_id
checks to MenusHelper::getMenuLinks()
so it returns only menus from frontend.
This method is used in core to fetch the menu items for the module and template "menu assignment" and by the JFormFieldMenuitem
to get the menu item list.
None
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_menus |
wondering if the method will also be used for the pr to come letting choose the components to be displayed/hidden in the container menu item. @izharaazmi
Beyond the scope of this PR... Agreed.
@infograf768 Yes. That's exactly what I did in my current work. PR pending.
When that comes, this may anyway be changed.
If you plan to use it in backend, I can adjust this PR accordingly of course. I just don't want to invest time into something which then isn't used at all.
I think an added client attribute is actually all it needs and it then should retain all other functionality. Would that be sufficient for your usecase?
Please don't invest any time on this function. I've already coded it. :-)
@izharaazmi do i understand well that we should wait your new pr and not merge this one?
Yes, I hope so. I'll send my PR very soon. We can wait a little.
I have tested this item
do i understand well that we should wait your new pr and not merge this one?
This can also be merged and @izharaazmi can solve the merge conflicts afterwards (if any).
The code here needs to go in anyway.
I have tested this item
@Bakual
To make it easier to @izharaazmi , would not it be better to patch this way?
diff --git a/administrator/components/com_menus/helpers/menus.php b/administrator/components/com_menus/helpers/menus.php
index c15ca1b..a8487e7 100644
--- a/administrator/components/com_menus/helpers/menus.php
+++ b/administrator/components/com_menus/helpers/menus.php
@@ -148,4 +148,8 @@
{
$db = JFactory::getDbo();
+
+ // Get site menu items per default
+ $clientId = 0;
+
$query = $db->getQuery(true)
->select('DISTINCT(a.id) AS value,
@@ -159,4 +163,5 @@
a.checked_out,
a.language,
+ a.client_id,
a.lft')
->from('#__menu AS a');
@@ -205,4 +210,5 @@
$query->where('a.published != -2');
+ $query->where('a.client_id = ' . $db->quote($clientId));
$query->order('a.lft ASC');
@@ -228,4 +234,5 @@
->from('#__menu_types')
->where('menutype <> ' . $db->quote(''))
+ ->where('client_id = ' . $db->quote($clientId))
->order('title, menutype');
$db->setQuery($query);
@infograf768 Let it be that way. I will resolve any conflicts when
committing. Let's not bother him needlessly :)
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC. Thanks.
@rdeutz please merge
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-30 08:19:41 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
Why? Until now, the method only returned frontend menuitems, the backend wasn't returned (I think because there was no menutype for that menu). This PR keeps the behavior inline with the existing one while keeping the change dead simple.
If there is a need to retrieve backend menuitems in future, this method would need at least a client argument and possibly other adjustments as well. But that is beyong what I try to fix in this PR.