Shop / e-Commerce Integration

Hikashop enrols users into the wrong role

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #1 by Web Buster UK Ltd
Hikashop enrols users into the wrong role was created by Web Buster UK Ltd
Joomla 3.6.2
Moodle 3.1.1
Joomdle 1.0.7

When a user buys a course through Hikashop (Joomla frontend), he is enrolled into the course as Teacher in Moodle. We have set manual enrolment default role as Student and joomdle enrolment default role as Student. When the user enrols through self-enrolment in Moodle, he is correctly placed as Student. Is there anything else we are missing?

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

More
9 years 10 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Hikashop enrols users into the wrong role
Hi.

I think it's the first time I've heard about this problem, so most likely it will have something to do with your specific configuration...
Have you changed roles in Moodle? Student has database id=5 in Moodle normal installation, and that's what Joomdle uses for enrolments.

Only other thing I can think of is: are you using profile types integration?

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

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #3 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Hikashop enrols users into the wrong role
HI, we have a Admin Account for Guests, can I let you log in and have a quick look?
You might spot something because we have installed this on 2 sites and its doing the same on both sites.

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

More
9 years 10 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Hikashop enrols users into the wrong role
Please send access to antonio at joomdle.com and I will take a quick look.

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

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #5 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Hikashop enrols users into the wrong role
Thank you

info sent

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

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #6 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Hikashop enrols users into the wrong role

Antonio Durán wrote: Hi.

I think it's the first time I've heard about this problem, so most likely it will have something to do with your specific configuration...
Have you changed roles in Moodle? Student has database id=5 in Moodle normal installation, and that's what Joomdle uses for enrolments.

Only other thing I can think of is: are you using profile types integration?


It seems to be a new issue, it had been working fine previously with Joomdle 1.0.6. Roles are unchanged moodle's defaults

We don't use profile types integration.

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

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #7 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Hikashop enrols users into the wrong role
Just for the benefit of other forum users:

Many thanks Antonio for your very prompt help, who has identified the issue is due to roleid=5 is Teacher and not Student.

Is there a way to set which role a user gets assigned after buying a course through Hikashop? This might solve our problem with the wrong role (id) being used.

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

More
9 years 10 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic Hikashop enrols users into the wrong role
You could modify Joomdle code to use the new role, but that will have you worrying about porting the changes every time you upgrade.

I have never seen that in a Moodle installation, so if I were you I would just reinstall, to avoid potential problems in the future.

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

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
9 years 10 months ago #9 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Hikashop enrols users into the wrong role
Reinstalling moodle seems to encounter the same problem, and we had noticed it is affecting course id's as well.

We are currently looking into this but one very possible reason is due to auto-increment in our MySQL database causing it to increment by 2 instead of 1 each time.

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

More
9 years 10 months ago #10 by Antonio Durán
Replied by Antonio Durán on topic Hikashop enrols users into the wrong role
I thought about that too (2 increment) but I never saw that in my life before.
But googling it, it seems it can happen:
dba.stackexchange.com/questions/5656/mys...crement-going-2-by-2

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