Results 1 to 5 of 5

Thread: custom module shows module_dir as Users

  1. #1
    lijith's Avatar
    lijith is offline Sugar Community Member
    Join Date
    Jun 2009
    Location
    India
    Posts
    67

    Lightbulb custom module shows module_dir as Users

    Hi,

    I have created a module. Then I created file "logic_hooks.php" at "custom\modules\<module_name>". But this file is not working at all. I tracked down the issue through by going to the file "include\utils\LogicHook.php" and look the variable $module_dir. This variable is displaying as "Users". This variable has to show as my <module_name>. If this works means I think my customized will work. Please help if there is any mistake I have done.

    Thanks in advance
    Lijith M Gopinath
    email : phpbugs@live.com
    website : PHP-Bugs

  2. #2
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: custom module shows module_dir as Users

    Can you post the code of your logic_hook?
    Please the code in custom/modules/<module_name>/logic_hooks.php and also the file that is required inside the logic_hook.php where you have your code to do your customizations.
    That way we can help you better.
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  3. #3
    lijith's Avatar
    lijith is offline Sugar Community Member
    Join Date
    Jun 2009
    Location
    India
    Posts
    67

    Default Re: custom module shows module_dir as Users

    Please go thru these

    logic_hooks.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['after_ui_frame'] = Array();
    $hook_array['after_ui_frame'][] = Array(1, 'test', 'custom/modules/TestModule/TestFile.php ','TestClass', 'TestFunc');
    ?>
    TestFile.php
    Code:
    <?php
    //prevents directly accessing this file from a web browser
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    class TestClass{
    	function TestFunc(& $focus, $event){
    		echo "i am here. ha ha ha ha ";
    	}
    }
    ?>

    Quote Originally Posted by eescribano View Post
    Can you post the code of your logic_hook?
    Please the code in custom/modules/<module_name>/logic_hooks.php and also the file that is required inside the logic_hook.php where you have your code to do your customizations.
    That way we can help you better.
    Lijith M Gopinath
    email : phpbugs@live.com
    website : PHP-Bugs

  4. #4
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: custom module shows module_dir as Users

    I don't find anything wrong... the only difference with my logic_hooks is that I define the functions like this:
    PHP Code:
    function name_function(&$bean$event$arguments) {
    [...]

    Have you tried with other events? just to know if it is working or not, for example you can try with before_save event and if you don't want to store anything just add an exit after the echo so it does not save the record.
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  5. #5
    lijith's Avatar
    lijith is offline Sugar Community Member
    Join Date
    Jun 2009
    Location
    India
    Posts
    67

    Default Re: custom module shows module_dir as Users

    No boss,
    my problem is that "logic_hooks.php" file is not calling. To call this file the variable $module_dir inside "include\utils\LogicHook.php" should return value as <module_name>. But this file returns the values as "Users". When I edited this page with the below code
    Code:
    $module_dir = "<module_name>";
    my "logic_hooks.php" runs successfully.

    Thanks!!!


    Quote Originally Posted by eescribano View Post
    I don't find anything wrong... the only difference with my logic_hooks is that I define the functions like this:
    PHP Code:
    function name_function(&$bean$event$arguments) {
    [...]

    Have you tried with other events? just to know if it is working or not, for example you can try with before_save event and if you don't want to store anything just add an exit after the echo so it does not save the record.
    Lijith M Gopinath
    email : phpbugs@live.com
    website : PHP-Bugs

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom module shows nothing in Last Viewed title
    By lir in forum Developer Help
    Replies: 10
    Last Post: 2009-07-16, 09:12 PM
  2. Add Users sub panel in Accounts module or Custom module
    By rameshsjc in forum Developer Help
    Replies: 0
    Last Post: 2009-06-12, 04:47 AM
  3. Replies: 2
    Last Post: 2009-04-07, 02:29 AM
  4. Replies: 4
    Last Post: 2009-01-05, 06:42 PM
  5. Users - Bug: Searching shows wrong results
    By malcolmh in forum Help
    Replies: 0
    Last Post: 2006-09-11, 09:41 AM

Tags for this Thread

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
  •