Results 1 to 5 of 5

Thread: Logic Hook Not Firing

  1. #1
    LX Dog is offline Sugar Community Member
    Join Date
    Jan 2011
    Posts
    45

    Question Logic Hook Not Firing

    Hi,

    Been a while since I played with sugar and just getting back into it with an install of 6.2.4 pro on ubuntu server 10.04.

    All is working well except I cant seem to get a simple logic hook to fire. Anyone se any problems with the following assuming file, class and function names are all correct?

    PHP Code:
    <?php
    // Do not store anything in this file that is not part of the array or the hook version.  This file will    
    // be automatically rebuilt in the future. 
     
    $hook_version 1
    $hook_array = Array(); 
    // position, file, function 
    $hook_array['before_save'] = Array(); 
    $hook_array['before_save'][] = Array(1'Leads push feed''modules/Leads/SugarFeeds/LeadFeed.php','LeadFeed''pushFeed'); 

    //custom logic hooks start - before_save

    $hook_array['before_save'][] = Array(2'Add Lead Account Code''modules/Leads/addcodehook.php','add_lead_ac_code_cs''add_lead_ac_code_fn');

    //custom logic hooks end - before_save

    $hook_array['after_ui_frame'] = Array(); 
    $hook_array['after_ui_frame'][] = Array(1'Leads InsideView frame''modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php','InsideViewLogicHook''showFrame'); 

    ?>
    This is in the custom/modules/Leads directory of my install. I simply added the line between the custom comments.

    Help - this is driving my little brain crazy!

    LX Dog

  2. #2
    ashdwi1's Avatar
    ashdwi1 is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    198

    Default Re: Logic Hook Not Firing

    Hi,
    Linux is case sensitive in case of file names.
    there is possibilities of this error.
    also pls provide your hook file for more debugging.
    thanks
    Almost available at skype or gtalk at ashdwi1.

    SugarForge Project:
    http://www.sugarforge.org/projects/gmapdirection
    Email: ashdwi1@gmail.com
    Mob: +919005468298

    Hire us at Odesk at
    https://www.odesk.com/users/~~b9eff8ff219fd705

    Hire Us at Elance at:
    http://ashdwi1.elance.com

  3. #3
    LX Dog is offline Sugar Community Member
    Join Date
    Jan 2011
    Posts
    45

    Question Re: Logic Hook Not Firing

    Hi,

    Checked the case of file name and its fine.

    Contents of the hook is simply for debugging purposes at the moment:

    PHP Code:
    <?php

    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class 
    add_lead_ac_code_cs
        

        function 
    add_lead_ac_code_fn(&$bean$event$arguments)
            {
                                                                    
    $bean->account_name "hello";
            }
        }

    ?>
    The hook will eventually populate the lead account name automatically but need to get the hook firing before populate with code I already have for this.

    Thoughts? Is it maybe a linux permissions issue?

    LX Dog

  4. #4
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Logic Hook Not Firing

    Also could be a permission issue for your file. Take a look if it is accessible for your web server user.
    Also try (just for test proposes), remove the first logic_hook for 'before_save' event and then use just yours, maybe it make the things easier.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  5. #5
    ashdwi1's Avatar
    ashdwi1 is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    198

    Default Re: Logic Hook Not Firing

    please try other fields rather than account_name , it should work.
    thanks
    Almost available at skype or gtalk at ashdwi1.

    SugarForge Project:
    http://www.sugarforge.org/projects/gmapdirection
    Email: ashdwi1@gmail.com
    Mob: +919005468298

    Hire us at Odesk at
    https://www.odesk.com/users/~~b9eff8ff219fd705

    Hire Us at Elance at:
    http://ashdwi1.elance.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Firing before_save logic hook from QuickCreate
    By jm_phila in forum Developer Help
    Replies: 9
    Last Post: 2011-10-26, 03:03 PM
  2. on 5.2 logic hook not firing
    By jimdelong in forum Developer Help
    Replies: 1
    Last Post: 2011-09-05, 03:31 AM
  3. Logic Hook not Firing after Log Call save?
    By bstonehill in forum Developer Help
    Replies: 1
    Last Post: 2010-11-10, 04:15 PM
  4. Please check my logic hook code - Not Firing
    By bstonehill in forum Help
    Replies: 12
    Last Post: 2010-01-22, 04:26 PM
  5. Logic Hook - Firing just once
    By leowolff in forum Help
    Replies: 2
    Last Post: 2010-01-20, 07:40 PM

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
  •