Results 1 to 4 of 4

Thread: TeamsOS errors with searching and dashlets (stamp/offset)

  1. #1
    gsrigg is offline Sugar Community Member
    Join Date
    Mar 2007
    Posts
    46

    Default FIXED IT - TeamsOS errors with searching and dashlets (stamp/offset)

    Hi all,

    The Stamp parameter in CRM seems to cause a problem with TeamsOS. Wondered if anyone else has encountered similar and can explain why. :-)

    If you go into the list view for leads, accounts, whatever, and look through the list, you'll notice the link into any entry is to the effect of....

    http://127.0.0.1/index.php?action=De...someidorother&offset=1&stamp=1197635337032891000

    Offset and Stamp being my concern. Stamp in particular. (I realise it's a time stamp, but don't see what it is for). The problem kicks in with Teams support in CRM.

    Example 1...

    Access denied when a user tries to open a record they should have access to. Users reported this to me so I did some digging around.

    Turned out to be when they clicked to get a "Detail View" on a record via any of the home page dashlets after first logging in. The reason, as it turned out, was the way the teams code works (I think!).... it kicks in and assesses access when you go to List View. If you go directly via Detail View it seems to fail.

    I proved the point with some testing.... if I logged in as a user and went to "Leads", got a "List View" and then went back to the home page - access via the dashlets worked perfectly, straight into detail view with no access denied!

    What was more bizarre was the fix! It turned out that if dropped the "stamp" from the URL the problem disappeared!! They could log in and get immediate access via the dashlets. Crazy eh?

    Example 2....

    Global/unified search (top right in CRM, searches all modules). It goes off and searches each module and presents a list of results. The same problem appears. If, for example, a lead comes back - they'll get access denied. BUT... if they go into the Leads modules as normal first and then do a search, it works!!!

    The problem here is that it's calling every module in CRM. So I needed a fix that would roll out system wide. It turns out if I edit...

    sugarcrm/include/ListView/ListViewGeneric.tpl

    ....and drop the "stamp", the problem disappears. Really quite confusing. But... if I make this change, it rolls out system wide too (not just searching).... the list view in every single module right across the board no longer has a "stamp" parameter.

    So the questions!...

    Any idea what it's there for in the first place?
    Any idea if there would be knock on or negative effects if I just remove it?

    Any help mucho appreciated! Thanks in advance.

    Cheers,
    ~Gary
    Last edited by gsrigg; 2007-12-16 at 11:59 AM.

  2. #2
    gsrigg is offline Sugar Community Member
    Join Date
    Mar 2007
    Posts
    46

    Default Re: TeamsOS errors with searching and dashlets (stamp/offset)

    Interesting, I added some code to Security_Check in TeamFormBase to check what was going on.... and it is getting the assigned team ID completely wrong. It's a valid team ID, but it is not the ID to which the item is assigned... Oddness...

    ~G

  3. #3
    gsrigg is offline Sugar Community Member
    Join Date
    Mar 2007
    Posts
    46

    Default Re: TeamsOS errors with searching and dashlets (stamp/offset)

    Alright, figured it out. All this offset and stamp business is for the VCR controls on the Detail View of a record. I proved the point by changing the stamp parameter to read "mystamp=" instead of "stamp=". Sugar ignored it, the team access problem went away completely, but the VCR controls got broke on the Detail View even if called from a List View.

    Solution... include/DetailView/DetailView.php, edit the method isRequestFromListView with an additional check...

    function isRequestFromListView($html_varName)
    {
    $varList = $this->getLocalSessionVariable($html_varName, "FROM_LIST_VIEW");
    if(isset($_GET['stamp']) && isset($varList) && $varList == $_GET['stamp']){

    // Extra check, gsr@a4, check referrer
    // In the case of search or dashlet, it contains module=Home
    // Now, means no VCR for search/dashlet but that's a small price
    $ref = getenv("HTTP_REFERER");
    if (stristr($ref,"module=home") === FALSE) {
    return true;
    } else {
    return false;
    }
    }
    else{
    return false;
    }
    }
    The effect.... if called from a dashlet or global/unified search, the referring URL contains module=Home, we catch it and return false. Otherwise, business as usual.

    Completely solves the problem and has one minor knock on effect.... you don't get VCR controls if you retrieve a record from either a dashlet or the global (top right) search. Search on any module is still fine. Granted, it's not perfect, but I'm happy with this for now.

    Cheers,
    ~G

  4. #4
    sidh211 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    126

    Default Re: TeamsOS errors with searching and dashlets (stamp/offset)

    hi
    i am using sugar 4.5.1i ce and teams os 3.3d

    we have added some fields in calls table but now when i click on NEXT button in the dashlet it gives an SQL error of
    SQL Error : Incorrect syntax near '*'. this error is because of tema module only.
    this is the sugal.log file contents.


    FATAL SugarCRM - Incorrect syntax near '*'.: SELECT TOP 6 * FROM
    (
    SELECT ROW_NUMBER() OVER (ORDER BY calls.id) AS row_number, count(*) counter, calls.id , calls_cstm.*, calls.status , calls.name , calls.duration_hours , calls.duration_minutes , calls.date_start , calls.time_start , calls.assigned_user_id
    from calls left join calls_cstm on calls.id = calls_cstm.id_c inner join calls_users on calls.id = calls_users.call_id where ((calls.status in ('planned')
    )) and calls.deleted=0 and calls_users.deleted = 0 and (calls.assigned_user_id = '1' or calls_users.user_id = '1')
    group by calls.id, calls_cstm.*, calls.status, calls.name, calls.duration_hours, calls.duration_minutes, calls.date_start, calls.time_start, calls.assigned_user_id
    ) AS a
    WHERE row_number > 5
    07/03/08 09:02:21,955 [1988] INFO SugarCRM - Query Execution Time:0.001204
    07/03/08 09:02:21,955 [1988] FATAL SugarCRM - SQL Server error: Incorrect syntax near '*'.
    07/03/08 09:02:21,984 [1988] DEBUG SugarCRM - ---------> END INCLUDING REQUESTED PAGE: [modules/Home/DisplayDashlet.php] <------------

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
  •