Open extra topbar

role

I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

role

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6075
    bigblue
    Participant

    Alex,

    Regarding the problem I reported in the cron thread, I think I found the issue.

    If the airdrp is for “any” role, it works. When it comes to specific roles, if the user has more than one role, it does not work. I use “User role editor” to assign more than one role to users.

    User Role Editor

    Please can you have a look?

    Thank you

    Best regards

    #6077
    alexg
    Keymaster

    Hello,

    Thank you very much for identifying and reporting this issue!

    I will investigate and fix this as soon as possible.

    with regards

    #6079
    alexg
    Keymaster

    Hello,

    I was unable to reproduce the problem.

    I used the plugin you suggested.

    1. I created a new role.

    2. I went to Users -> (picked a user) -> Capabilities, then assigned the new capability as a secondary capability.

    3. I performed an airdrop to that user role. As a test, I used a “Fixed amount airdrop” and I set the “Variable amount airdrop” factor to 0, to keep things simple. The airdrop was applied correctly to the user with the new role only.

    The plugin uses the get_users() function to retrieve users with the specified role.

    Can you check again? What parameters did you use? Can you verify the above procedure?

    with regards

    #6086
    bigblue
    Participant

    Hi Alex,

    Yes, you are right, it is correct. I made some tests and found out that it is not working only for some specific roles.

    I checked the capabilities for those specific roles, and having wllts right, why should an airdrp not working for those roles?

    When I launch the ardrp, it redirects me correctly to transctions table, but no record for the ardrp.

    Any suggetion?

    Thank you in advance Alex

    #6089
    alexg
    Keymaster

    No, no reason at all that I can think of.

    After enabling the WordPress debug logs, do you see any error in your logs printed out at the moment you perform the airdrop?

    #6091
    bigblue
    Participant

    Alex, I enabled debug, and performed several ardp ttsts for that particular role with no success, but in the debug file I found this unique entry (it is normal?):

    [01-Apr-2019 13:25:14 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 43 for query
    INSERT INTO xxxx_wallets_txs (
    blog_id,
    category,
    tags,
    account,
    address,
    txid,
    symbol,
    amount,
    created_time,
    updated_time,
    status,
    comment
    )
    SELECT
    1 AS blog_id,
    ‘deposit’ AS category,
    ‘airdrop ad-5ca21127e86ef’ AS tags,
    u.ID AS account,
    UUID() AS address,
    UUID() AS txid,
    ‘LTC’ AS symbol,
    1.0000000000 + 0.0000000000 * IFNULL( balances.balance, 0) AS amount,
    ‘2019-04-01 13:25:14’ AS created_time,
    ‘2019-04-01 13:25:14’ AS updated_time,
    ‘done’ AS status,
    ‘Airdrop’ AS comment
    FROM
    xxxx_users u
    LEFT JOIN
    (
    SELECT
    t.account AS account,
    SUM( t.amount ) AS balance
    FROM
    xxxx_wallets_txs t
    WHERE
    symbol = ‘LTC’
    AND status = ‘done’
    GROUP BY
    t.account
    ) balances
    ON ( balances.account = u.ID ) WHERE u.ID IN () made by require_once(‘wp-admin/admin.php’), do_action(‘admin_init’), WP_Hook->do_action, WP_Hook->apply_filters, Dashed_Slug_Wallets_Airdrop_Settings->do_airdrop

    #6093
    alexg
    Keymaster

    Thanks for finding this.

    There is a minor bug here – if the plugin does not find any users, it still attempts the SQL query and fails, thus writing what you saw in the logs. I will fix this in the next patch.

    But the main problem remains: I am still not sure why the extension doesn’t find any users with your specified role.

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