Answers.Body: <p>I just figured it out. </p>
  
  <p>When using the loadForm function you have to include at least 1 parameter in the URL. If you do not include a parameter then you will get the error.</p>
  
  <p><strong>Is this a bug?</strong></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-13T09:25:17.887Z
Answers.Text: Most urls in civicrm include the `reset=1` parameter. I dont know why.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-10T16:29:49.893Z
Answers.LastActivityDate: 2018-08-10T16:29:49.893Z
Answers.UserDisplayName: Sleewok
Body: <p>In all of my custom extensions, when I use the loadForm function to load a form (generated with Civix) as a popup, I get the following error:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'split' of undefined
  at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:167:34)
  at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:144:25)
  at HTMLDivElement.&lt;anonymous&gt; (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:256:40)
  at Function.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:370:19)
  at jQuery.fn.init.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:137:17)
  at jQuery.fn.init.$.fn.(anonymous function) [as crmSnippet] (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:236:10)
  at HTMLDivElement.&lt;anonymous&gt; (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:441:34)
  at HTMLDivElement.dispatch (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5226:27)
  at HTMLDivElement.elemData.handle (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:4878:28)
  at Object.trigger (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5130:12)
  </code></pre>
  
  <p>Apparently Civi replaces the default buttons with some other buttons. This error breaks that process. I noticed this when trying to use the Shoreditch theme (my buttons disappeared). </p>
  
  <p>I'm unsure how to approach debugging this. Any ideas on what would cause this with my forms loaded in popups? The standalone page loads just fine with the buttons.</p>
  
Tags: <extension><quickform>
Title: LoadForm Popup - Uncaught TypeError: Cannot read property 'split' of undefined
ThreadText: # LoadForm Popup - Uncaught TypeError: Cannot read property 'split' of undefined
  
  (Asked by: username_0 on 2018-08-10)
  
  In all of my custom extensions, when I use the loadForm function to load a form (generated with Civix) as a popup, I get the following error:
  
  ```
  Uncaught TypeError: Cannot read property 'split' of undefined
  at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:167:34)
  at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:144:25)
  at HTMLDivElement.<anonymous> (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:256:40)
  at Function.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:370:19)
  at jQuery.fn.init.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:137:17)
  at jQuery.fn.init.$.fn.(anonymous function) [as crmSnippet] (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:236:10)
  at HTMLDivElement.<anonymous> (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:441:34)
  at HTMLDivElement.dispatch (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5226:27)
  at HTMLDivElement.elemData.handle (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:4878:28)
  at Object.trigger (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5130:12)
  
  ```
  
  Apparently Civi replaces the default buttons with some other buttons. This error breaks that process. I noticed this when trying to use the Shoreditch theme (my buttons disappeared).
  
  I'm unsure how to approach debugging this. Any ideas on what would cause this with my forms loaded in popups? The standalone page loads just fine with the buttons.
  
  **Tags:** extension, quickform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-08-10. Score: 1 | Accepted answer
  
  I just figured it out.
  
  When using the loadForm function you have to include at least 1 parameter in the URL. If you do not include a parameter then you will get the error.
  
  **Is this a bug?**
  
  > **Comments:**
  > **username_1**: Most urls in civicrm include the `reset=1` parameter. I dont know why.  
  
  ---
  
  