1

Thanks for the help in solving the problem! Nice to have all the ajax working properly again.

Regarding the title of the question.... It seems like there's a (large?) gap between the errors I encountered and the solution for them. I'm wondering what I could have done to troubleshoot more...? maybe if I had gone to a non-english page I would have encountered different errors...? Is there anything that can be recommended regarding how I could've troubleshooted this more effectively? This issue seems completely mysterious to me, so while "go ask the friendly people online" can yield easy solutions sometimes as it did this time, I'd like to learn something a little deeper here if possible :)


After updating to 5.4.1 Contact pages are behaving oddly...

  • Activities don't show up at all until a filter is toggled (for example, there are 10 activities it says, but it displays none of them, but then changing the filters to exclude any type of activity will cause all 10 of the activities to appear).
  • Relationships don't show up at all (and they don't have any ajaxy toggle thing to magically make them appear).

In the browser's debugging console I see

  • Uncaught SyntaxError: Unexpected token <
  • Refused to execute script from 'http://ourwebsite.org/civicrm/contact/undefinedjs/jquery/jquery.crmAjaxTable.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

When Civi cache is flushed at /civicrm/admin/setting/updateConfigBackend a fatal error occurs followed by a backtrace. They mention 'ajax' a number of times (and that's all that stands out to me as meaningful. it says "DB Error: No such field" too, but I have no idea what field doesn't exist so maybe these errors are unrelated?)...

ID         :  6869
Date       :  28/Aug 19:48
Type       :  civicrm
Severity   :  debug
Message    :
              $Fatal Error Details = array(3) {
                ["message"]=>
                string(23) "DB Error: no such field"
                ["code"]=>
                NULL
                ["exception"]=>
                object(CiviCRM_API3_Exception)#181 (8) {
                  ["extraParams":"CiviCRM_API3_Exception":private]=>
                  array(4) {
                    ["error_code"]=>
                    string(13) "no such field"
                    ["tip"]=>
                    string(62) "add debug=1 to your API call to have more info about the error"
                    ["is_error"]=>
                    int(1)
                    ["error_message"]=>
                    string(23) "DB Error: no such field"
                  }
                  ["message":protected]=>
                  string(23) "DB Error: no such field"
                  ["string":"Exception":private]=>
                  string(0) ""
                  ["code":protected]=>
                  int(0)
                  ["file":protected]=>
                  string(65)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/api/api.php"
                  ["line":protected]=>
                  int(45)
                  ["trace":"Exception":private]=>
                  array(10) {
                    [0]=>
                    array(4) {
                      ["file"]=>
                      string(78)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php"
                      ["line"]=>
                      int(3340)
                      ["function"]=>
                      string(12) "civicrm_api3"
                      ["args"]=>
                      array(3) {
                        [0]=>
                        &string(8) "uf_group"
                        [1]=>
                        &string(3) "get"
                        [2]=>
                        &array(2) {
                          ["name"]=>
                          array(1) {
                            ["IN"]=>
                            array(3) {
                              [0]=>
                              string(14) "new_individual"
                              [1]=>
                              string(16) "new_organization"
                              [2]=>
                              string(13) "new_household"
                            }
                          }
                          ["is_active"]=>
                          int(1)
                        }
                      }
                    }
                    [1]=>
                    array(6) {
                      ["file"]=>
                      string(76)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Resources.php"
                      ["line"]=>
                      int(689)
                      ["function"]=>
                      string(14) "getCreateLinks"
                      ["class"]=>
                      string(20) "CRM_Core_BAO_UFGroup"
                      ["type"]=>
                      string(2) "::"
                      ["args"]=>
                      array(0) {
                      }
                    }
                    [2]=>
                    array(4) {
                      ["function"]=>
                      string(20) "outputLocalizationJS"
                      ["class"]=>
                      string(18) "CRM_Core_Resources"
                      ["type"]=>
                      string(2) "::"
                      ["args"]=>
                      array(0) {
                      }
                    }
                    [3]=>
                    array(4) {
                      ["file"]=>
                      string(73)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php"
                      ["line"]=>
                      int(275)
                      ["function"]=>
                      string(14) "call_user_func"
                      ["args"]=>
                      array(1) {
                        [0]=>
                        &array(2) {
                          [0]=>
                          string(18) "CRM_Core_Resources"
                          [1]=>
                          string(20) "outputLocalizationJS"
                        }
                      }
                    }
                    [4]=>
                    array(6) {
                      ["file"]=>
                      string(73)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php"
                      ["line"]=>
                      int(84)
                      ["function"]=>
                      string(7) "runItem"
                      ["class"]=>
                      string(15) "CRM_Core_Invoke"
                      ["type"]=>
                      string(2) "::"
                      ["args"]=>
                      array(1) {
                        [0]=>
                        &array(12) {
                          ["id"]=>
                          string(3) "149"
                          ["domain_id"]=>
                          string(1) "1"
                          ["path"]=>
                          string(20) "civicrm/ajax/l10n-js"
                          ["access_callback"]=>
                          string(1) "1"
                          ["access_arguments"]=>
                          array(2) {
                            [0]=>
                            array(1) {
                              [0]=>
                              string(14) "access CiviCRM"
                            }
                            [1]=>
                            string(3) "and"
                          }
                          ["page_callback"]=>
                          array(2) {
                            [0]=>
                            string(18) "CRM_Core_Resources"
                            [1]=>
                            string(20) "outputLocalizationJS"
                          }
                          ["breadcrumb"]=>
                          array(1) {
                            [0]=>
                            array(2) {
                              ["title"]=>
                              string(7) "CiviCRM"
                              ["url"]=>
                              string(16) "/civicrm?reset=1"
                            }
                          }
                          ["is_ssl"]=>
                          string(1) "0"
                          ["weight"]=>
                          string(1) "1"
                          ["type"]=>
                          string(1) "1"
                          ["page_type"]=>
                          string(1) "0"
                          ["page_arguments"]=>
                          bool(false)
                        }
                      }
                    }
                    [5]=>
                    array(6) {
                      ["file"]=>
                      string(73)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php"
                      ["line"]=>
                      int(52)
                      ["function"]=>
                      string(7) "_invoke"
                      ["class"]=>
                      string(15) "CRM_Core_Invoke"
                      ["type"]=>
                      string(2) "::"
                      ["args"]=>
                      array(1) {
                        [0]=>
                        &array(4) {
                          [0]=>
                          string(7) "civicrm"
                          [1]=>
                          string(4) "ajax"
                          [2]=>
                          string(7) "l10n-js"
                          [3]=>
                          string(5) "en_US"
                        }
                      }
                    }
                    [6]=>
                    array(6) {
                      ["file"]=>
                      string(75)
              "/home/milk/dev_html/docroot/sites/all/modules/civicrm/drupal/civicrm.module"
                      ["line"]=>
                      int(445)
                      ["function"]=>
                      string(6) "invoke"
                      ["class"]=>
                      string(15) "CRM_Core_Invoke"
                      ["type"]=>
                      string(2) "::"
                      ["args"]=>
                      array(1) {
                        [0]=>
                        &array(4) {
                          [0]=>
                          string(7) "civicrm"
                          [1]=>
                          string(4) "ajax"
                          [2]=>
                          string(7) "l10n-js"
                          [3]=>
                          string(5) "en_US"
                        }
                      }
                    }
                    [7]=>
                    array(2) {
                      ["function"]=>
                      string(14) "civicrm_invoke"
                      ["args"]=>
                      array(3) {
                        [0]=>
                        &string(4) "ajax"
                        [1]=>
                        &string(7) "l10n-js"
                        [2]=>
                        &string(5) "en_US"
                      }
                    }
                    [8]=>
                    array(4) {
                      ["file"]=>
                      string(45) "/home/milk/dev_html/docroot/includes/menu.inc"
                      ["line"]=>
                      int(527)
                      ["function"]=>
                      string(20) "call_user_func_array"
                      ["args"]=>
                      array(2) {
                        [0]=>
                        &string(14) "civicrm_invoke"
                        [1]=>
                        &array(3) {
                          [0]=>
                          string(4) "ajax"
                          [1]=>
                          string(7) "l10n-js"
                          [2]=>
                          string(5) "en_US"
                        }
                      }
                    }
                    [9]=>
                    array(4) {
                      ["file"]=>
                      string(37) "/home/milk/dev_html/docroot/index.php"
                      ["line"]=>
                      int(21)
                      ["function"]=>
                      string(27) "menu_execute_active_handler"
                      ["args"]=>
                      array(0) {
                      }
                    }
                  }
                  ["previous":"Exception":private]=>
                  NULL
                }
              }

and the backtrace that followed:

ID         :  6870                                                                              
Date       :  28/Aug 19:48                                                                      
Type       :  civicrm                                                                           
Severity   :  debug                                                                             
Message    :  $backTrace = #0                                                                   
              /home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Error.php(459):    
              CRM_Core_Error::backtrace("backTrace", TRUE)                                      
              #1 /home/milk/dev_html/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php(55): 
              CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))          
              #2                                                                                
              /home/milk/dev_html/docroot/sites/all/modules/civicrm/drupal/civicrm.module(445): 
              CRM_Core_Invoke::invoke((Array:4))                                                
              #3 [internal function](): civicrm_invoke("ajax", "l10n-js", "en_US")              
              #4 /home/milk/dev_html/docroot/includes/menu.inc(527):                            
              call_user_func_array("civicrm_invoke", (Array:3))                                 
              #5 /home/milk/dev_html/docroot/index.php(21): menu_execute_active_handler()       
              #6 {main}                                                                         

I don't know if those Drupal log entries are related to this problem, but I do suspect the javascript errors are...

Could the problem lie in jquery.crmAjaxTable.js? Doing chmod +x jquery.crmAjaxTable.js doesn't solve that.

But now after clearing the cache again have a couple more js errors, in addition to the two above are these:

  • Error: CRM.url called before initialization CRM.console @ Common.js?pe6q8l:1605 CRM.url @ crm.ajax.js?pe6q8l:19 crmFormInline @ Summary.js?pe6q8l:23 (anonymous) @ Summary.js?pe6q8l:201 dispatch @ jquery.min.js?pe6q8l:3 r.handle @ jquery.min.js?pe6q8l:3
  • crm.ajax.js?pe6q8l:26 Uncaught TypeError: Cannot read property 'back' of undefined at Object.CRM.url (crm.ajax.js?pe6q8l:26) at crmFormInline (Summary.js?pe6q8l:23) at HTMLDivElement.<anonymous> (Summary.js?pe6q8l:201) at HTMLDivElement.dispatch (jquery.min.js?pe6q8l:3) at HTMLDivElement.r.handle (jquery.min.js?pe6q8l:3) CRM.url @ crm.ajax.js?pe6q8l:26 crmFormInline @ Summary.js?pe6q8l:23 (anonymous) @ Summary.js?pe6q8l:201 dispatch @ jquery.min.js?pe6q8l:3 r.handle @ jquery.min.js?pe6q8l:3
  • It looks like the upgrade script did not run successfully - did it give any errors? Do you have a multilingual site? Is audit logging turned on? – user4278 Aug 29 '18 at 1:33
  • I don't recall any errors from the upgrade script. The site is multilingual (Drupal+i18n). What do you mean by "audit" logging? – alec Aug 29 '18 at 1:37
  • well what we normally call logging - creates log tables. Try running the api System.rebuildmultilingualschema – user4278 Aug 29 '18 at 4:00
  • Check the answers to this issue. Sounds similar civicrm.stackexchange.com/q/25888/4519 – ericG Aug 31 '18 at 22:26
  • 1
    yes! cv api System.rebuildmultilingualschema and cache flush and it's now working properly. Thanks @user4278 and @ericG! – alec Sep 1 '18 at 3:03
0

What stands out to me in your error report is the word "undefined" in http://ourwebsite.org/civicrm/contact/undefinedjs/jquery/jquery.crmAjaxTable.js. I think your resource url setting may have been messed up. Check Administer -> System Settings -> Resource URLs.

  • The CiviCRM Resource URL is [civicrm.root]/. – alec Aug 29 '18 at 1:45
  • I don't know what that token is for though. The CIviCRM module is located in sites/all/modules/civicrm... is that what that token is referring to? I assume it's not referring to the Drupal root...? I'm looking into replacing that token with a hardcoded value to see if that makes a difference... – alec Aug 29 '18 at 1:50
  • I followed the check at docs.civicrm.org/user/en/latest/initial-set-up/resource-urls (finding the civicrm.css file when viewing the source and then loading it in the browser, the browser can load it)... so seemingly it's not a problem in the Resource Urls...? – alec Aug 29 '18 at 1:59
  • But yeah, undefined stands out, right? More undefined in here: <div class="menu-item"><span>Customize Data and Screens</span><img class="menu-item-arrow" src="undefinedpackages/jquery/css/images/arrow.png" style="top: 4px;"></div> – alec Aug 29 '18 at 2:01
  • Looks like for some reason CRM.config.resourceBase is undefined. – Coleman Aug 29 '18 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.