Duplicate tabs as menu items in Navigation. See screenshot.

CommentFileSizeAuthor
crm_core_ux_menu.png36.54 KBygerasimov

Comments

cr0ss’s picture

Status: Active » Needs review

Got this issue fixed by creating Navigation links on modules installing.

dealancer’s picture

Status: Needs review » Needs work

Your commit could be found here http://drupalcode.org/project/crm_core.git/commitdiff/8e806e471a68e2ac65....

1. This functions works in not expected way:


+function crm_ui_get_crm_mlid() {
+  $plid = variable_set('crm_ui_plid', -1);  // Overrides existing value of the variable
+
+  if (empty($plid) || $plid == -1) { // this condition is always TRUE because of previous line 
+    $crm_plid = menu_link_get_preferred('crm', 'navigation');
+    $plid = $crm_plid['mlid'];
+    variable_set('crm_ui_plid', $plid);
+  }
+
+  return $plid;
 }

Moreover we don't use crm_ui_plid anywhere in the code, so it is better to get rid of it and update this function to following code which will work faster then before:


function crm_ui_get_crm_mlid() {
  return menu_link_get_preferred('crm', 'navigation');
}

P.S.

In future, if you want other people to make a review, please create a patch before committing. It is good for making code better that is going to be committed.

dealancer’s picture

Actually it should be

+  $plid = variable_get('crm_ui_plid', -1);  
-  $plid = variable_set('crm_ui_plid', -1);  
cr0ss’s picture

Status: Needs work » Needs review

Fixed

dealancer’s picture

With a recent dev install nothing happens.

P.S.

Please, do not commit and then set status to needs review. It is not very good, cause people immediately get update in the dev version, which could break anything.

The good workflow is:

1) Make changes
2) Make diff
3) Add path to the issue
4) Update status to needs review

Make commits in case if you are sure that it will work good and if this patch was reviewed before.

dealancer’s picture

Status: Needs review » Needs work
Anonymous’s picture

Status: Needs work » Closed (works as designed)

Fixed in latest development release.

  • Commit 8e806e4 on 7.x-1.x, development, import by cr0ss:
    Issue #1539526 by ygerasimov: UX. Menu links.
    
    
  • Commit ac4e8e3 on 7.x-1.x, development, import by cr0ss:
    Issue #1539526 - Fixing variable_set to variable_get
    
    

  • Commit 8e806e4 on 7.x-1.x, development, import, activity_pages by cr0ss:
    Issue #1539526 by ygerasimov: UX. Menu links.
    
    
  • Commit ac4e8e3 on 7.x-1.x, development, import, activity_pages by cr0ss:
    Issue #1539526 - Fixing variable_set to variable_get
    
    

  • cr0ss committed 8e806e4 on og_integration
    Issue #1539526 by ygerasimov: UX. Menu links.
    
    
  • cr0ss committed ac4e8e3 on og_integration
    Issue #1539526 - Fixing variable_set to variable_get
    
    

  • cr0ss committed 8e806e4 on mail
    Issue #1539526 by ygerasimov: UX. Menu links.
    
    
  • cr0ss committed ac4e8e3 on mail
    Issue #1539526 - Fixing variable_set to variable_get