Back to GD Topic Polls (Lite) Forum

Recent update removed ability for non-admins to create polls

Published on: August 3, 2021 at 3:44 am · By: Vanessa
Author
Topic
#66437

The recent version of Topic polls that was released a week ago removed the ability for non-admins to create a poll.
The ability doesn’t show when creating a new topic.
Admins can see it, but non-admins can’t.
I checked the settings to ensure bbpress forum participants have access, and they do.
I checked the example user to confirm they are a participant, and they are, but no checkbox to create a poll is shown.

This only started happening after upgrading both GD bbpress and the polls plugin to the latest version.
My GD Bbpress version is 6.1.4, polls plugin is version 3.1.2

Topic Information
Bug Report
7.4
5.7
3.1.2
Viewing 15 replies - 1 through 15 (of 15 total)
Author
Replies
  • #66438

    Thanks for reporting. I will investigate this, and release the update as soon as possible.

    Milan

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
  • #66439

    Hi,

    I have tested the latest plugin version (GD Topic Polls Pro 3.3.3), and it works fine, I can create polls with users with any role enabled in the plugin settings.

    You are using a version from last year (3.1.2 was released over a year ago). I checked the list of plugins you downloaded, and your last download was over a year ago. You have not updated anything since then. Dev4Press Updater plugin has to be updated regularly (at least twice a year) to maintain update access, and you have not updated the Updater plugin for a long time. GD bbPress Toolbox Pro is currently at the 6.5.1 version.

    Start by manually updating the Dev4Press Updater to 4.4.2 (latest version) – you can download it from this page: https://updater.dev4press.com/ and follow the Manual Update info from this page: https://updater.dev4press.com/install/

    Let me know when you test with new versions of the plugin (3.3.3). If it doesn’t work, it is possible that something else is wrong, but try new version first.

    Regards,
    Milan

    Dev4Press - Premium plugins for WordPress.

  • #66444

    Hi there,

    I upgraded to
    GDBBPress Pro 6.5.2
    and GD Topic Polls Pro 3.3.3

    The issue is still present on my sites even after the update.
    I resaved the permissions again and cleared all caches, but participants are still not able to create a poll.

    Let me know if you need any more info to help you debug.

  • #66445

    Hi,

    Do you have some membership-related plugin, or maybe something dealing with user roles, or some custom code that may explain this?

    GD Topic Polls actually modifies bbPress roles on each page load to add new ‘gdpol_create_poll’ capability. All user roles with this capability can create new polls. There is nothing else related to check if the user can create a poll.

    Regards,
    Milan

    Dev4Press - Premium plugins for WordPress.

  • #66479

    We have the same issue (as you know).

    No role can add topic polls anymore (admin/keymaster or participant/subscriber.

    We use the “Paid Memberships Pro” system to collect donations, but this worked before, then with a plugin / wordpress 5.8 update die clickbox to add a poll with a new topic post disappeared.

    We are unsure what triggers the disappearance of the click box … and we wonder if there is any other way to let regular members created new topic polls?

  • #66480

    Yes we use PMPPro as well.

    I did some more investigation, and it looks like somehow the capability gdpol_create_poll is now added to each WordPress role as disabled.

    A workaround is to go to each WordPress role and specifically enable this capability. Which can be a pain if you have a lot of roles.

    We used the Members – Membership & User Role Editor Plugin

    I do think it’s an issue recently introduced by either GD Polls or PMPPro recently. We never experienced this issues before last month.

    1 user thanked author for this post.
  • #66483

    I am not sure why that happens. My plugin assigns that capability and sets it to ‘true’ or ‘false’ based on the role enabled for polls in the plugin settings. It is not setting the capability to individual users, only roles.

    So, the only three things coming to mind are: (1) the old issue bbPress had that some code related to user roles is called before bbPress was ready resulting in issues with the way roles work (that should throw a warning in code); (2) somehow the role settings are saved in wp_options even so they should not be saved (bbPress roles are all dynamic, they should not be saved anywhere). If a plugin (like PMP) is doing something to the roles processing, it might cause this; (3) capability value is somehow added to the user (again, plugin like PMP may be doing something) with wrong value.

    I have this on the list for deeper testing, and I will attempt to setup the PMP plugin to see if I can debug the issue, and if the issue is possible to replicate.

    In the meantime, I will try to release plugin update next week that will introduce filter to override the capability check.

    Milan

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
  • #66484

    Thanks for keeping an eye on it, and trying to fix it in some way .. regardless of what other plugin is (likely) causing it, and not yours!

  • #66485

    Version 3.3.4 adds a new filter. Here is the use example:

    add_filter('gdpol_user_can_create_poll', 'custom__gdpol_user_can_create_poll', 10, 2);
    function custom__gdpol_user_can_create_poll($can, $user_id) {
      // $can has to be TRUE or FALSE, and you can modify it here before returning.
      // $user_id is the ID of the current user, or 0 if the user is not logged in.
    
      return $can;
    }

    Dev4Press - Premium plugins for WordPress.

  • #66486

    Thanks for staying on top of this.

    Version 3.3.4 did not make any difference on our site – see the acreenshot attached. Same as before (for admins and for participants).

  • #66488

    I would not expect it to make any change, the way the plugin works has not changed.

    In my previous reply, I provided you with an example code for a new filter that can be used to override access to the topic polls. So, in your case, for some reason, the capability is set to false for nonadmin users, but with the filter provided, you can do your own checks to see who can access the form.

    Here is that code with a check for allowed user roles:

    add_filter('gdpol_user_can_create_poll', 'custom__gdpol_user_can_create_poll', 10, 2);
    function custom__gdpol_user_can_create_poll($can, $user_id) {
      if ($can === false && $user_id > 0) {
        $can = d4p_is_current_user_roles(array('bbp_keymaster', 'bbp_moderator', 'bbp_participant'));
      }
     
      return $can;
    }

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
  • #66489

    Thank you very much!

    I am embarrassed to ask … how do I use the filter, where do I copy / paste it to?

    Thanks,
    Kevin
    Volunteer Administrator

  • #66490

    You can add it to theme functions.php file, or you can add mu-plugins file: https://support.dev4press.com/kb/article/adding-custom-code-into-must-use-plugin/

    Dev4Press - Premium plugins for WordPress.

  • #73751

    Hi, all. We just recently released an update for PMPro Roles (v1.4.1) that I think may solve the issue you are having here. Can you let me know if you still see issues with users losing roles when changing levels (other than the ones they are supposed to lose) after updating?

    There are lots of moving parts here, so it’s possible the issues described here are similar but different. But we did fix a bug where roles were being dropped by accident in this recent update, and I’d like to know if it works for ya or if we need to keep digging. Thanks.

    FYI the update will not fix old users. It will only fix the issue going forward.

  • #73753

    Hey, thanks for the update on the issue. My plugin just adds the new capability to the bbPress dynamic role and sets it to ‘true’, and that should not be saved in the DB for role or use (bbPress dynamic roles), and for users using PMP plugin for some reason that gets saved.

    Dev4Press - Premium plugins for WordPress.

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.