March 29, 2019 at 12:59 am #6075
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.
Please can you have a look?
Best regardsMarch 29, 2019 at 8:42 am #6077
Thank you very much for identifying and reporting this issue!
I will investigate and fix this as soon as possible.
with regardsMarch 29, 2019 at 4:53 pm #6079
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 regardsMarch 30, 2019 at 11:02 am #6086
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.
Thank you in advance AlexApril 1, 2019 at 10:14 am #6089
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?April 1, 2019 at 1:34 pm #6091
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 (
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
t.account AS account,
SUM( t.amount ) AS balance
symbol = ‘LTC’
AND status = ‘done’
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_airdropApril 3, 2019 at 6:54 am #6093
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.
- You must be logged in to reply to this topic.