change user group mass action bug?

  • Posts: 79
  • Thank you received: 3
9 years 8 months ago #194303

-- HikaShop version -- : Business: 2.3.5
-- Joomla version -- : 3.2.3
-- PHP version -- : 5.3.3
-- Error-message(debug-mod must be tuned on) -- : Controlled exception.
Error message obtained at screen via hikashop_display() function (see attached image)

I have a custom field in user table named user_type
Type Radio button
3 options:
1st: Value = Individual; Title = Individual (Default value)
2nd: Value = No_VAT; Title = Company without VAT Number
3rd: Value = With_VAT; Title = Company with VAT Number

I have a Joomla User group named Clients with 3 groups subordinated to it
|— Registered
|—|— Clients
|—|—|— Company No VAT
|—|—|— Company VAT
|—|—|— Individual

I have Joomla User default group on registration set to Clients
At Hikashop System->Configuration->Checkout->Login & Registration->User group on registration, I tried both, Inherit and Clients and I obtained same results.

Here is the bug(?):

I created 3 user mass actions in order to change user group on registration depending on user_type custom field value

Filters:
User colum: user_type = Individual/No_VAT/With_VAT
Actions:
Change user group: Replace Individual/Company No VAT/Company VAT

respectively.

I try folowing triggers:
1.- Before create/update user, results in nothing happend, user group is the default group, no change.
2.- After create/update user, results on:
a)creation of user
b)no activation email sent
c)user group is the default group, no change
d)Finally I get the following error message at screen (see error_msg.jpg): "SQL=DELETE FROM xhtml46542_user_usergroup_map WHERE user_id IN (Array)"

Is this a bug or am I forgetting something?


Regards

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #194347

Hi,

Thanks for the report.
Please replace:

$db->setQuery('DELETE FROM '.hikashop_table('user_usergroup_map',false).' WHERE user_id IN ('.$user_ids.')');
By:
$db->setQuery('DELETE FROM '.hikashop_table('user_usergroup_map',false).' WHERE user_id IN ('.implode(',',$user_ids).')');

In the file "plugins/hikashop/massaction_user/massaction_user.php" function "onProcessUserMassActionchangeGroup()".

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 3
9 years 8 months ago #194454

Thanks Xavier, I tried your solution and error message didn't appear anymore, but Joomla group didn't change, still remain at default user group Clients (maybe you must check this behaviour for future versions).

Any way, I soved my problem tried another solution and I don't need to change the usergroup anymore.

Thanks and Regards

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #194464

Hi,

Ok I will do more tests, but when I tested on my end the usergroup was correctly changed.
Thanks for the report.

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum