Answers.Body: <p>I have found a partial solution...</p>
  
  <p>To wrap the CiviCRM shortcode in a Members shortcode (which would have been the 'old' / pre-gutenberg block way to do it)</p>
  
  <p><code>[members_logged_in][civicrm component="user-dashboard"][/members_logged_in]</code></p>
  
  <p>The content is then restricted to logged in users (in this instance) and no visible errors are thrown, though while the form works it appears some Javascript/CSS is not loaded on the page when the shortcode is nested - which others have also come across here: <a href="https://civicrm.stackexchange.com/questions/27838/request-login-on-edit-mode-profile-form">Request login on edit mode profile form</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T16:15:14.603Z
Answers.LastActivityDate: 2020-06-10T16:15:14.603Z
Answers.UserDisplayName: Christopher
Answers.Body: <p>Digging a little deeper, I think I have discovered why the nesting of the shortcodes works.</p>
  
  <ul>
  <li>CiviCRM html header is not present (1), resulting in</li>
  <li>Uncaught ReferenceError: CRM is not defined (2)</li>
  </ul>
  
  <p>So the page breaks at the point of validation meaning no errors are thrown.  Resulting in an error solving an error.</p>
  
  <p>Unfortunately I am at the limits of my knowledge to properly solve the original error, which looks like it is caused by either/and/or:</p>
  
  <ul>
  <li>Members plugin not restricting content fully - though as I get the same error with similar plugins doing the same thing as the restriction is only on page content rather than in the header so perhaps a fix is needed elsewhere if inclusions in the header cannot be restricted</li>
  <li>WordPress continuing to load content even though a plugin has restricted it - which it isn't as the scripts and styles are loaded in the header which the plugin does not restrict.</li>
  </ul>
  
  <p>However fixing both of those would then result in CRM validation which would throw the original error...</p>
  
  <p>Could the CiviCRM shortcode have parameters to either fail silently (which means the WordPress plugin / WordPress code could continue its business), or have similar restriction functionality baked in so that CiviCRM code can do all the hard work.</p>
  
  <p>(1)</p>
  
  <pre><code>&lt;!-- CiviCRM html header --&gt;
  &lt;script type="text/javascript"&gt;
  var CRM = {"config":{"isFrontend":true,"wysisygScriptLocation":"\/wordpress\/wp-content\/plugins\/civicrm\/civicrm\/js\/wysiwyg\/crm.ckeditor.js","CKEditorCustomConfig":{"default":"https:\/\/[...]\/uploads\/civicrm\/persist\/crm-ckeditor-default.js"}}};
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery/dist/jquery.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/jquery-ui.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/lodash-compat/lodash.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.form.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.timeentry.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.blockUI.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/js/jquery.dataTables.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-validation/dist/jquery.validate.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/Common.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.datepicker.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.ajax.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/wysiwyg/crm.wysiwyg.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/crm/ajax/l10n-js/en_GB/?cid=2&amp;r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tableHeader.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.notify.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.optionEdit.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/ui/i18n/datepicker-en-GB.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.wordpress.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/css/crm-i.css?r=pLAwt" rel="stylesheet" type="text/css"/&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css"/&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.css" rel="stylesheet" type="text/css"/&gt;
  &lt;link href="https://[...]/plugins/civicrm/civicrm/css/searchForm.css?r=pLAwt" rel="stylesheet" type="text/css"/&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.searchForm.js?r=pLAwt"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/noconflict.js?r=pLAwt"&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>(2)</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
      CRM.$(function($) {
        $("form.CRM_Contact_Form_GroupContact").crmValidate();
      });
    &lt;/script&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-12T15:30:34.067Z
Answers.LastActivityDate: 2020-06-12T15:30:34.067Z
Answers.UserDisplayName: Christopher
Body: <p>I am setting up some member self-service pages, restricting access using the 'Members' plugin, to show (on separate pages):</p>
  
  <ul>
  <li>a profile to allow members to update their details via <code>[civicrm component="profile" mode="edit" gid="1"]</code> (different errors depending on view or edit modes)</li>
  <li>Dashboard so that invoices and event bookings are visible via <code>[civicrm component="user-dashboard"]</code></li>
  </ul>
  
  <p>But still getting the following error:</p>
  
  <ul>
  <li><p>Error with anonymous / not logged in user and viewing profile (if the
  mode="edit" then redirects to homepage)
  <a href="https://i.sstatic.net/68TRI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/68TRI.png" alt="Error with anonymous user and viewing profile"></a></p></li>
  <li><p>Error with anonymous / not logged in user and viewing Dashboard
  <a href="https://i.sstatic.net/rhcY9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rhcY9.png" alt="Error with anonymous user and Dashboard"></a></p></li>
  </ul>
  
  <p>'Members' plugin is working as expected and I can successfully set it up to restrict content and show custom messages. CiviCRM permissions appear to be correct / default.</p>
  
  <p>I was not expecting to get any CiviCRM error messages as the content was restricted and not showing, though something is triggering the error messages / redirection.</p>
  
  <p>I have checked with a clean install of both WordPress (5.4.1) and CiviCRM (5.25.0 and 5.26.0), and even used other plugins that do similar content restriction but all to the same end.</p>
  
  <p>I am pretty new to CiviCRM so any suggestions as to fix this / or where to look would be much appreciated.</p>
  
  <p>The back trace posted below for the view profile states 'Could not find the required contact id parameter (id=) for viewing a contact ...' which is understandable, though why it is trying to find contact id when the content is restricted is puzzling me.</p>
  
  <p>backTrace</p>
  
  <pre><code>#0 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(337): CRM_Core_Error::backtrace()
  #1 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(52): CRM_Core_Error::fatal("Could not find the required contact id parameter (id=) for viewing a contact ...")
  #2 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(152): CRM_Profile_Page_View-&gt;preProcess()
  #3 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Profile_Page_View-&gt;run((Array:3), NULL)
  #4 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
  #5 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #6 [...]/wp-content/plugins/civicrm/civicrm.php(1479): CRM_Core_Invoke::invoke((Array:3))
  #7 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(328): CiviCRM_For_WordPress-&gt;invoke()
  #8 [...]/wp-includes/shortcodes.php(343): CiviCRM_For_WordPress_Shortcodes-&gt;render_single((Array:3), "", "civicrm")
  #9 [internal function](): do_shortcode_tag((Array:7))
  #10 [...]/wp-includes/shortcodes.php(218): preg_replace_callback("/\[(\[?)(civicrm)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\...", "do_shortcode_tag", "[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
  #11 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(214): do_shortcode("[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
  #12 [...]/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress_Shortcodes-&gt;prerender(Object(WP))
  #13 [...]/wp-includes/class-wp-hook.php(311): WP_Hook-&gt;apply_filters("", (Array:1))
  #14 [...]/wp-includes/plugin.php(544): WP_Hook-&gt;do_action((Array:1))
  #15 [...]/wp-includes/class-wp.php(748): do_action_ref_array("wp", (Array:1))
  #16 [...]/wp-includes/functions.php(1274): WP-&gt;main("")
  #17 [...]/wp-blog-header.php(16): wp()
  #18 [...]/index.php(17): require("[...]/wp-blog-header.php")
  #19 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-06T22:15:27.063Z
Comments.Text: In the CiviCRM shortcode [civicrm component="profile" mode="edit" gid="1"], can you confirm that gid="1" does relate to the relevant profile id that you should have set up in Administer>Customize data and screens>Profiles?
Comments.UserDisplayName: peterb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T08:44:37.720Z
Comments.Text: It does, I have tried it with profiles I have created (and default profiles).  All the profiles (and the dashboard) work as expected as a functional profile with a logged in user.
Comments.UserDisplayName: Christopher
Tags: <wordpress><profile><error><user-dashboard>
Title: Restricted access to the WordPress page but still getting errors: 'Sorry, due to an error, we are unable to fulfill your request at the moment.'
ThreadText: # Restricted access to the WordPress page but still getting errors: 'Sorry, due to an error, we are unable to fulfill your request at the moment.'
  
  (Asked by: username_0 on 2020-06-06)
  
  I am setting up some member self-service pages, restricting access using the 'Members' plugin, to show (on separate pages):
  
  * a profile to allow members to update their details via `[civicrm component="profile" mode="edit" gid="1"]` (different errors depending on view or edit modes)
  * Dashboard so that invoices and event bookings are visible via `[civicrm component="user-dashboard"]`
  
  But still getting the following error:
  
  * Error with anonymous / not logged in user and viewing profile (if the
    mode="edit" then redirects to homepage)
    [![Error with anonymous user and viewing profile](https://i.sstatic.net/68TRI.png)](https://i.sstatic.net/68TRI.png)
  * Error with anonymous / not logged in user and viewing Dashboard
    [![Error with anonymous user and Dashboard](https://i.sstatic.net/rhcY9.png)](https://i.sstatic.net/rhcY9.png)
  
  'Members' plugin is working as expected and I can successfully set it up to restrict content and show custom messages. CiviCRM permissions appear to be correct / default.
  
  I was not expecting to get any CiviCRM error messages as the content was restricted and not showing, though something is triggering the error messages / redirection.
  
  I have checked with a clean install of both WordPress (5.4.1) and CiviCRM (5.25.0 and 5.26.0), and even used other plugins that do similar content restriction but all to the same end.
  
  I am pretty new to CiviCRM so any suggestions as to fix this / or where to look would be much appreciated.
  
  The back trace posted below for the view profile states 'Could not find the required contact id parameter (id=) for viewing a contact ...' which is understandable, though why it is trying to find contact id when the content is restricted is puzzling me.
  
  backTrace
  
  ```
  #0 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(337): CRM_Core_Error::backtrace()
  #1 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(52): CRM_Core_Error::fatal("Could not find the required contact id parameter (id=) for viewing a contact ...")
  #2 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(152): CRM_Profile_Page_View->preProcess()
  #3 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Profile_Page_View->run((Array:3), NULL)
  #4 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
  #5 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #6 [...]/wp-content/plugins/civicrm/civicrm.php(1479): CRM_Core_Invoke::invoke((Array:3))
  #7 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(328): CiviCRM_For_WordPress->invoke()
  #8 [...]/wp-includes/shortcodes.php(343): CiviCRM_For_WordPress_Shortcodes->render_single((Array:3), "", "civicrm")
  #9 [internal function](): do_shortcode_tag((Array:7))
  #10 [...]/wp-includes/shortcodes.php(218): preg_replace_callback("/\[(\[?)(civicrm)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\...", "do_shortcode_tag", "[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
  #11 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(214): do_shortcode("[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
  #12 [...]/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress_Shortcodes->prerender(Object(WP))
  #13 [...]/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters("", (Array:1))
  #14 [...]/wp-includes/plugin.php(544): WP_Hook->do_action((Array:1))
  #15 [...]/wp-includes/class-wp.php(748): do_action_ref_array("wp", (Array:1))
  #16 [...]/wp-includes/functions.php(1274): WP->main("")
  #17 [...]/wp-blog-header.php(16): wp()
  #18 [...]/index.php(17): require("[...]/wp-blog-header.php")
  #19 {main}
  
  ```
  
  **Tags:** wordpress, profile, error, user-dashboard
  
  > **Comments:**
  > **username_1**: In the CiviCRM shortcode [civicrm component="profile" mode="edit" gid="1"], can you confirm that gid="1" does relate to the relevant profile id that you should have set up in Administer>Customize data and screens>Profiles?  
  > **username_0**: It does, I have tried it with profiles I have created (and default profiles).  All the profiles (and the dashboard) work as expected as a functional profile with a logged in user.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2020-06-10. Score: 1 | Accepted answer
  
  I have found a partial solution...
  
  To wrap the CiviCRM shortcode in a Members shortcode (which would have been the 'old' / pre-gutenberg block way to do it)
  
  `[members_logged_in][civicrm component="user-dashboard"][/members_logged_in]`
  
  The content is then restricted to logged in users (in this instance) and no visible errors are thrown, though while the form works it appears some Javascript/CSS is not loaded on the page when the shortcode is nested - which others have also come across here: [Request login on edit mode profile form](https://civicrm.stackexchange.com/questions/27838/request-login-on-edit-mode-profile-form).
  
  
  ---
  
  ### Answer by username_0 on 2020-06-12. Score: 0
  
  Digging a little deeper, I think I have discovered why the nesting of the shortcodes works.
  
  * CiviCRM html header is not present (1), resulting in
  * Uncaught ReferenceError: CRM is not defined (2)
  
  So the page breaks at the point of validation meaning no errors are thrown. Resulting in an error solving an error.
  
  Unfortunately I am at the limits of my knowledge to properly solve the original error, which looks like it is caused by either/and/or:
  
  * Members plugin not restricting content fully - though as I get the same error with similar plugins doing the same thing as the restriction is only on page content rather than in the header so perhaps a fix is needed elsewhere if inclusions in the header cannot be restricted
  * WordPress continuing to load content even though a plugin has restricted it - which it isn't as the scripts and styles are loaded in the header which the plugin does not restrict.
  
  However fixing both of those would then result in CRM validation which would throw the original error...
  
  Could the CiviCRM shortcode have parameters to either fail silently (which means the WordPress plugin / WordPress code could continue its business), or have similar restriction functionality baked in so that CiviCRM code can do all the hard work.
  
  (1)
  
  ```
  <!-- CiviCRM html header -->
  <script type="text/javascript">
  var CRM = {"config":{"isFrontend":true,"wysisygScriptLocation":"\/wordpress\/wp-content\/plugins\/civicrm\/civicrm\/js\/wysiwyg\/crm.ckeditor.js","CKEditorCustomConfig":{"default":"https:\/\/[...]\/uploads\/civicrm\/persist\/crm-ckeditor-default.js"}}};
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery/dist/jquery.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/jquery-ui.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/lodash-compat/lodash.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.form.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.timeentry.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.blockUI.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/js/jquery.dataTables.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-validation/dist/jquery.validate.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/Common.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.datepicker.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.ajax.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/wysiwyg/crm.wysiwyg.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/crm/ajax/l10n-js/en_GB/?cid=2&r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tableHeader.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.notify.min.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.optionEdit.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/ui/i18n/datepicker-en-GB.js">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.wordpress.js?r=pLAwt">
  </script>
  <link href="https://[...]/plugins/civicrm/civicrm/css/crm-i.css?r=pLAwt" rel="stylesheet" type="text/css"/>
  <link href="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
  <link href="https://[...]/plugins/civicrm/civicrm/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
  <link href="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
  <link href="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.css" rel="stylesheet" type="text/css"/>
  <link href="https://[...]/plugins/civicrm/civicrm/css/searchForm.css?r=pLAwt" rel="stylesheet" type="text/css"/>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.searchForm.js?r=pLAwt">
  </script>
  <script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/noconflict.js?r=pLAwt">
  </script>
  
  ```
  
  (2)
  
  ```
    <script type="text/javascript">
      CRM.$(function($) {
        $("form.CRM_Contact_Form_GroupContact").crmValidate();
      });
    </script>
  
  ```
  
  
  ---
  
  