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 / not logged in user and viewing Dashboard
'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}