DATA Mappings with VM

  • shekar
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
15 years 5 months ago #1 by shekar
DATA Mappings with VM was created by shekar
I am using Data Mappings with VM and the fields are as the below attached image:



Issue 1
All fields are mapping well except the country field.

Issue 2
Data mappings working perfectly for new users, but whenever an existing user updates his account information its not updating the same in moodle.


Thanks
Shekar

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

More
15 years 5 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Re: DATA Mappings with VM
Thanks for the bug report. I will look into it as soon as possible.

Some questions:
- When you say id does not map, what do you mean? That the field is not filled at all?
- Are you usingo moodle 1.9 or 2.0?

Antonio

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

  • shekar
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
15 years 5 months ago #3 by shekar
Replied by shekar on topic Re:DATA Mappings with VM
1. The country field in moodle is empty.
2. I am using Moodle 1.9.

Thanks
Shekar

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

More
15 years 5 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Re:DATA Mappings with VM
Hi.

I finally had some time to take a lok at this:

Issue 1. I fixed it in my development code. Let me know if you want me to explain the fix so you can patch your installation.

Issue 2. Confirmed it. Looked at VM code, and it seems it does not fire Joomla user update events, so the update code is not executed.
I studied VM code to try to come with a workaround, but I have not found a way to fix it (without modifying VM code)

Antonio

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

  • shekar
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
15 years 5 months ago #5 by shekar
Replied by shekar on topic Re:DATA Mappings with VM
Thanks Antonio,

Issue 1: Yes, please tell me how to fix this. :woohoo:
Issue 2: :S



Thanks again...
Shekar

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

More
15 years 5 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic Re:DATA Mappings with VM
To fix the country, I added a new function in administrator/components/com_joomdle/helpers/mappings.php:
Code:
function get_vm_country ($country) { $db =& JFactory::getDBO(); $query = "SELECT country_2_code" . ' FROM #__vm_country' . " WHERE country_3_code = " . $db->Quote($country); $db->setQuery($query); $value = $db->loadResult(); if (!$value) return ""; return $value; }


And in function get_field_value_virtuemart, add this before the return:
Code:
if ($field == 'country') $field_object->$field = JoomdleHelperMappings::get_vm_country ($field_object->$field);

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

  • shekar
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
15 years 5 months ago #7 by shekar
Replied by shekar on topic Re:DATA Mappings with VM
Its working thanks again....

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