Posted: February 21, 2014 at 11:30 pm
|
As an admin why is it that I can see a Question Group created by another user but cannot use that Question Group on an event that I create? |
Hi Kirk, That is actually by design,with the Espresso Roles & Permissions Add-on each user has their own Question Groups & Promo codes to use within their own events. However there is a filter in place we can use to remove the check for the current user. Just add remove_filter('espresso_get_question_groups_for_event_where', 'espresso_rp_basic_get_question_groups_for_event_where', 10); To wp-content/uploads/espresso/custom_functions.php (if the file is not there currently, create a blank php file, open with the opening php tag <?php Then paste the code above into that file. |
|
|
Okay uploaded the wp-content/uploads/espresso/custom_functions.php file with the following code <?php but not noticing any change in the interface. |
Hi Kirk, I’d advise against closing the PHP tag ‘?>’ as it helps avoid Headers already sent issues. (White space after the closing tag which can be hard to track down – More Info) With that code in place all users should see the question groups created by other users within the Event Editor and be able to allocate those questions to their events if they wish, is that not the case? |
|
|
Removed the closing ?> php tag but still not seeing question groups from other users as choices when editing an event. |
HI Kirk, I must apologise, I had assumed you were using R&P Basic but looking at your account it would appear you are likely using R&P Pro. If that is the case you will also need to add: remove_filter('espresso_get_question_groups_for_event_where', 'espresso_rp_pro_get_question_groups_for_event_where', 15); In the same custom_functions.php file. Does that then allow you to view all question groups within the Event Editor? |
|
|
Added the line for R&P Pro but still not seeing others’ questions groups. <pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”><?php |
|
The default behavior is for only question groupss created by the wp_user ids of 0 and 1 to show up in the event editor. To get it to display all question groups you’ll need to add add_filter('espresso_get_question_groups_for_event_where', 'custom_espresso_get_question_groups_for_event_where', 10, 3); function custom_espresso_get_question_groups_for_event_where($where, $existing_question_groups, $event) { return ''; } in addition to the code that Tony posted. Note that since each admin has their own set of question groups, you will see what seem to be duplicates, such as the Address information group. But if you hover over them, you will see that they each have a distinct group_id. |
|
that finally makes it work! it would be awesome to show “Created by user x” next to each question group. I don’t mind too much having to look at the group id in the status bar. but i really can’t expect other event managers to do the same thing. so just to clarify, this code is just for choosing questions right? in other words, if the code were to be removed next month, the existing data won’t be affected right? because it’s custom code i totally understand it not looking perfect. but it would be great to have an official user-friendly version of this implemented in a future update. P.S. (not sure what you all are doing to format code that my forum posts aren’t doing.) |
Hi Kirk, Those filters are only used when adding or editing an event. If the code above were to be removed the only change would be that only the users that created the question/group would see those question again.
I agree and will add this to out internal feature request list. Regarding code. Hope that helps. |
|
|
Not sure if it’s related to these changes we’ve added but a new problem just popped up. Out of the blue a couple questions have disappeared from the registration page. As you can see in the screenshot below, Age & Gender questions are turned on in the settings. Also the “Show group name on registration page?” is turned off. [IMG]http://i.imgur.com/EspOu1R.png[/IMG] In the screenshot below note the way Age & Gender questions do not show up. Also the group name is being displayed. [IMG]http://i.imgur.com/R2RjqAn.png[/IMG] It can’t be an issue of using the wrong Question Group because, as you can see in the screenshot below, there is only one Personal Information group and as a system group is automatically selected and cannot be turned off. [IMG]http://i.imgur.com/kngUzTt.png[/IMG] What is causing this to happen and how can it be fixed? |
Hi Kirk, Are the questions assigned to the corresponding question groups? You can find out if the issue is related to the code changes by temporarily removing the custom code as well. |
|
|
It strangely fixed itself. Actually, fixed it by saving the event without making any changes. Why would simply saving the event (making no changes) fix the problem with the questions? |
|
Hi Kirk, Good question and one that’s hard to answer. It could simply be the act of saving reset something that was needed. Currently it would be a good idea to monitor the issue and see if it re-occurs, and if it does so, get in touch with us. |
The support post ‘Question Group created by other users’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.