Results 1 to 5 of 5

Thread: Sugar 4 Problems / Bugs

  1. #1
    pnovess is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    22

    Default Sugar 4 Problems / Bugs

    Great job on the new digs Sugar Folks. However, there are a few bugs I didn't see in the beta.

    1) When I clecik the accounts tab I get this message sometimes -

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /u1/srvr/html/ss/include/utils/array_utils.php on line 62

    2) When I go to my account and view the module access, the module names are missing. At least it was for the admin account.

    3) How do we add a new module to the acl?

    Thanks,
    phill

  2. #2
    andydreisch's Avatar
    andydreisch is offline Sugar Team Member
    Join Date
    Apr 2005
    Location
    San Jose
    Posts
    2,080

    Default Re: Sugar 4 Problems / Bugs

    Hi pnovess,

    We'll try to reproduce #1. It did not come up in our testing. Can you identify a pattern? And it is only the Accounts module?

    Module names do not appear when you view your ACL accesses via My Account. This is a known issue. Module names do appear when you establish ACLs in admin, of course. (Open question: is it useful for the My Accounts area to display the ACLs for the user?)

    I'll ask the lead engineer to comment on having ACLs cover new modules.

    Andy
    Andy Dreisch
    Vice President, Online Team


    Check out our Podcasts!
    Sugar University for training
    Sugar Wiki for developer and user help
    SugarForge for modules, themes, lang packs
    SugarExchange for production-ready extensions
    Enter/view bugs via the Sugar bug tracker

  3. #3
    majed's Avatar
    majed is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    198

    Post Re: Sugar 4 Problems / Bugs

    How do we add a new module to the acl?

    Adding new modules to support acl is acctually quite easy. It's getting them to enforce the acl rules that is the fun part.

    So first lets tell the module that it supports ACLs:

    So here is the code to do that inside MyModule.php:
    Code:
    function bean_implements($interface){
         switch($interface){
                case 'ACL':return true;
           }
          return false;
    }
    Now lets get the module ready to respect ACLs:
    use ACLController::checkAccess(Module Name, view (list, view, edit, import, export, access, delete), is current user owner) to check if a user has access to a module. Alternatively if you have instantiated a bean you can call $bean->ACLAccess(view, is_owner (it will check on it's own if you don't pass this parameter in)
    In Menu.php
    change the menu items to be like this
    Code:
    global $mod_strings;
    if(ACLController::checkAccess('Cases', 'view', true)) $module_menu [] = Array("index.php?module=Cases&action=EditView&return_module=Cases&return_action=DetailView",$mod_strings['LNK_NEW_CASE'],"CreateCases");
    
    if(ACLController::checkAccess('Cases', 'list', true))$module_menu [] = Array("index.php?module=Cases&action=index&return_module=Cases&return_action=DetailView", $mod_strings['LNK_CASE_LIST'],"Cases");
    This will check if the user has access to see the menu items.
    Now open DetailView.html and check to make sure the Delete button has the name 'Delete', the duplicate button has the Name 'Duplicate', and the Edit button has the name 'Edit'. This will allow them to automatically be disabled when the user doesn't have access to those views.


    Now on the listview.html around the links that go to the detail view for your object change the
    Code:
     <a> and </a> to {TAG.MAIN} 
    so if I had 
    <a href='index.php?module=MyModule&action=DetailView>Object Name</a> 
    it would become 
    <{TAG.MAIN} href='index.php?module=MyModule&action=DetailView>Object Name</{TAG.MAIN}>
    ]

    depending on if a user has access to the object or not it will replace it with a tag of a or span. Now if you have relationships and the relationships show in the list view you will need to create more tags like if you had an account that shows in the ListView you would need to add {TAG.ACCOUNT} in replacement of the
    Code:
    <a> and </a> tags
    Then you would need to go into your module file MyModule.php and create a function as follows
    Code:
    function listviewACLHelper(){
    
    		$array_assign = parent::listviewACLHelper();
    
    		$is_owner = false;
    
    		if(!empty($this->account_id)){
    
    			
    
    			if(!empty($this->account_id_owner)){
    
    				global $current_user;
    
    				$is_owner = $current_user->id == $this->account_id_owner;
    
    			}
    
    		}
    
    			if(!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)){
    
    				$array_assign['ACCOUNT'] = 'a';
    
    			}else{
    
    				$array_assign['ACCOUNT'] = 'span';
    
    			}
    
    		
    
    		return $array_assign;
    
    	}
    Now if you have a link to related account coming up on the detail view. You will need to add this to the detailview.php file
    Code:
    $xtpl->assign("TAG", $focus->listviewACLHelper());
    and edit the DetailView.html in a similar fashion to what you have done for the ListView.html

    That should get you on your way. There is one last thing once you have made the changes you need them to be installed. To do that login as admin and hit the following url on your site index.php?module=ACL&action=install_actions and now your module should appear in the admin section.

    If I left out any information or you need more help please just let me know.

    Thanks,
    Majed
    Last edited by majed; 2005-12-19 at 07:32 AM.
    Majed Itani
    Software Engineer
    SugarCRM Inc.

  4. #4
    lawron is offline Junior Member
    Join Date
    Dec 2005
    Posts
    3

    Default Re: Sugar 4 Bugs

    the first bug:

    in modules/campaigns/varderf.php

    line 191

    should change

    'OPTIONS'=>'CAMPAING_STATUS_DOM'

    to

    'OPTIONS'=>'CAMPAING_STATUS_DOM'

    the second bug

    in tab Campaign - New Prospect list edit view, the type dropdown has now value, and it can not be null, so we can not creat an new list. also we do not find the values in dropdown edit view.

  5. #5
    pnovess is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    22

    Default Re: Sugar 4 Problems / Bugs

    Thanks Majed for the detailed info. I'm not that far yet but I will give it a try.

    Yesterday I did find a few more "bugs".

    1) Export does not export anything, whether checkd or unchecked. Previously export exported EVERYTHING even when items were checked. Now nothing.

    2) Mail merge always uses everything whether checked or unchecked.

    3) When you change the tab order in admin. It does ONLY changes for admin. account.

    4) This error presents itself "Error retrieving record. You may not be authorized to view this record." when you click the History subpanel "Related to" link to an account from inside the account. This happens as admin.

    Thanks,
    Philll

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •