TypeError: tagName is null oin click of add email in related list in custom module

StackOverflow https://stackoverflow.com/questions/18567968

  •  27-06-2022
  •  | 
  •  

Question

I am getting error TypeError: tagName is null on click of add Email in custom module related list.

I am using code from Accounts.php from account module.

function get_emails($id, $cur_tab_id, $rel_tab_id, $actions=false) {
    global $log, $singlepane_view,$currentModule,$current_user, $adb;
    $log->debug("Entering get_emails(".$id.") method ...");
    $this_module = $currentModule;

    $related_module = vtlib_getModuleNameById($rel_tab_id);
    require_once("modules/$related_module/$related_module.php");
    $other = new $related_module();
    vtlib_setup_modulevars($related_module, $other);
    $singular_modname = vtlib_toSingular($related_module);
    $parenttab = getParentTab();

    if ($singlepane_view == 'true')
        $returnset = '&return_module=' . $this_module
            . '&return_action=DetailView&return_id=' . $id;
    else
        $returnset = '&return_module=' . $this_module
            . '&return_action=CallRelatedList&return_id=' . $id;

    $button = '';
    $button .= '<input type="hidden" name="email_directing_module">
                <input type="hidden" name="record">';    

    .....all code from that file....modules/Accounts/Accuonts.php

    if ($return_value == null) $return_value = Array();
    $return_value['CUSTOM_BUTTON'] = $button;

    $log->debug("Exiting get_emails method ...");
    return $return_value;
}

Please help for this. Thanks in advance.

Was it helpful?

Solution

First of all i explain my problem. So its easy to understand. I have added relatedlist in my custom module. If singlepane view is disabled then it displays in more information tab. When i click on add email button, one popup window open. And when click on select button error comes that TypeError: tagName is null. Now to solve this problem go to website/Smarty/templates/RelatedLists.tpl. In that their is a if condition for each module on line number(near about) 149. Add your module name in that condition and your problem is solved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top