- Posts: 10
Baby Steps
- Chaim Handler
-
Topic Author
- Offline
- New Member
-
Less
More
11 years 8 months ago #1
by Chaim Handler
Baby Steps was created by Chaim Handler
Wish I didn't have to bother you but I can't find much info for beginners beyond the installation stage.
I figured the simplest first step would be to add a user in Joomla and see what shows up in moodle.
Before that worked I needed to manually modify quite a few get_instance calls to ::instance
in joomdle scripts. If you have updated scripts please tell me where to get them.
The standard administrator Joomla user registration page has no first name/last name fields,
so basically what I saw in moodle when I displaying a list of users was a blank entry,
though when displaying the user's details I saw some of the data that I entered in Joomla,
so it clearly created the user and copied the fields that were common to both systems.
Can someone please tell me what I have to do to add the missing moodle fields to the Joomla
registration page, and if after doing so if the fields will magically be copied to moodle,
or if I will need to make more changes.
Any assistance is truly appreciated!
C. Handler
I figured the simplest first step would be to add a user in Joomla and see what shows up in moodle.
Before that worked I needed to manually modify quite a few get_instance calls to ::instance
in joomdle scripts. If you have updated scripts please tell me where to get them.
The standard administrator Joomla user registration page has no first name/last name fields,
so basically what I saw in moodle when I displaying a list of users was a blank entry,
though when displaying the user's details I saw some of the data that I entered in Joomla,
so it clearly created the user and copied the fields that were common to both systems.
Can someone please tell me what I have to do to add the missing moodle fields to the Joomla
registration page, and if after doing so if the fields will magically be copied to moodle,
or if I will need to make more changes.
Any assistance is truly appreciated!
C. Handler
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
11 years 8 months ago #2
by Chris
Replied by Chris on topic Baby Steps
Hi there,
Baby steps .... As simple as it may seem, just follow the installation steps. You should not need to modify any code at all. Joomdle has been installed on thousands of sites following the steps in the wiki.
A few hints:
- If using any 3rd party registration plugins disable until you get things working and then try enabling to see if any conflicts. Joomdle does support a number of such plugins and many more work but not all plugins work in the same manner.
- Before integrating any other components, eg. shop, social network, membership, etc. get Joomdle working successfully
- Before using any Joomdle modules ensure you can get a basic Moodle courses view running in Joomdle.
- Most importantly ensure you have all green ticks in the System Health Check. If not, something will not work correctly.
Baby steps .... As simple as it may seem, just follow the installation steps. You should not need to modify any code at all. Joomdle has been installed on thousands of sites following the steps in the wiki.
A few hints:
- If using any 3rd party registration plugins disable until you get things working and then try enabling to see if any conflicts. Joomdle does support a number of such plugins and many more work but not all plugins work in the same manner.
- Before integrating any other components, eg. shop, social network, membership, etc. get Joomdle working successfully
- Before using any Joomdle modules ensure you can get a basic Moodle courses view running in Joomdle.
- Most importantly ensure you have all green ticks in the System Health Check. If not, something will not work correctly.
Please Log in or Create an account to join the conversation.
- Chaim Handler
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
11 years 8 months ago #3
by Chaim Handler
Replied by Chaim Handler on topic Baby Steps
Chris, I really appreciate your response.
First of all I am totally installed, thanks. All my System Health Checks are green.
Secondly, I did need to make modifications because in moodle 2.7 the get_context_instance function was deprecated. An annoyance but not the end of the world once I managed to debug the problem.
There's even a thread in the forum where Antonio mentions he is in the process of making the necessary modifications (see: "Not Syncronizing User").
Finally, I have no 3rd party registrations plugins installed. I used Joomla's built in add user function from the control panel (v3.3) and there is a single full name field and no first / last name. Moodle not only has a first and last name, but the list users function in moodle site administration lists the users in the system by first and last names. So when I added a user in Joomla I was pleased to find the user added in moodle, but disappointed to find the user listed as spaces rather than by the name I entered in Joomla.
The problem is very straightforward: joomla - no first/last name; moodle - first/last name required.
Am I the only person to have encountered this or am the only one dumb enough that the solution isn't obvious to me?
Thanks again. This whole open-source helping out one another culture of programming is totally awesome!
First of all I am totally installed, thanks. All my System Health Checks are green.
Secondly, I did need to make modifications because in moodle 2.7 the get_context_instance function was deprecated. An annoyance but not the end of the world once I managed to debug the problem.
There's even a thread in the forum where Antonio mentions he is in the process of making the necessary modifications (see: "Not Syncronizing User").
Finally, I have no 3rd party registrations plugins installed. I used Joomla's built in add user function from the control panel (v3.3) and there is a single full name field and no first / last name. Moodle not only has a first and last name, but the list users function in moodle site administration lists the users in the system by first and last names. So when I added a user in Joomla I was pleased to find the user added in moodle, but disappointed to find the user listed as spaces rather than by the name I entered in Joomla.
The problem is very straightforward: joomla - no first/last name; moodle - first/last name required.
Am I the only person to have encountered this or am the only one dumb enough that the solution isn't obvious to me?
Thanks again. This whole open-source helping out one another culture of programming is totally awesome!
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
11 years 8 months ago #4
by Chris
Replied by Chris on topic Baby Steps
OK so you are using 2.7, then yes there is that issue.
As for your other question re user fields, what Joomla does not have, it cannot pass. Thus you have a few choices:
- Use the Joomla user profile plugin to make available additional fields
- Use a 3rd party extension such as EasySocial, shop, etc. and leverage their fields
- Let Moodle manage the fields
By default Joomdle with parse the name field (if non of the above happens). So if you register John Doe in the name field in Joomla it will appears as John in the first name field in Moodle and Doe in the last name field in Moodle. Of course this does not work for all nationalities and races but a large number of the Joomla / Moodle users.
Most people lock the Moodle fields and implement some form of user profile.
As for your other question re user fields, what Joomla does not have, it cannot pass. Thus you have a few choices:
- Use the Joomla user profile plugin to make available additional fields
- Use a 3rd party extension such as EasySocial, shop, etc. and leverage their fields
- Let Moodle manage the fields
By default Joomdle with parse the name field (if non of the above happens). So if you register John Doe in the name field in Joomla it will appears as John in the first name field in Moodle and Doe in the last name field in Moodle. Of course this does not work for all nationalities and races but a large number of the Joomla / Moodle users.
Most people lock the Moodle fields and implement some form of user profile.
Please Log in or Create an account to join the conversation.
- Chaim Handler
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
11 years 8 months ago #5
by Chaim Handler
Replied by Chaim Handler on topic Baby Steps
<< Use the Joomla user profile plugin to make available additional fields >>
Excellent advice. Now we're cooking. Googled and I see this means essentially copying an existing plugin and making modifications. There wouldn't happen to be such a profile existing that has the same fields as moodle?
Say I prepare such a profile, how do I link the fields in the custom Joomla user profile and moodle/joomdle?
If you can give me a link to a webpage somewhere that explains how to do these things it would be a tremendous help.
Excellent advice. Now we're cooking. Googled and I see this means essentially copying an existing plugin and making modifications. There wouldn't happen to be such a profile existing that has the same fields as moodle?
Say I prepare such a profile, how do I link the fields in the custom Joomla user profile and moodle/joomdle?
If you can give me a link to a webpage somewhere that explains how to do these things it would be a tremendous help.
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
11 years 8 months ago #6
by Chris
Replied by Chris on topic Baby Steps
No need to copy any plugins 
A list of 3rd party integrations .... www.joomdle.com/wiki/3rd_Party_Integration
- Also you can use the inbuilt Joomla plugin docs.joomla.org/Creating_a_profile_plugin or customise it further if you want more / different features
Once you have chosen your desired approach or even better have a look first at what to do next so you know what to look for in above
Look down for data mapping - www.joomdle.com/wiki/Features
A list of 3rd party integrations .... www.joomdle.com/wiki/3rd_Party_Integration
- Also you can use the inbuilt Joomla plugin docs.joomla.org/Creating_a_profile_plugin or customise it further if you want more / different features
Once you have chosen your desired approach or even better have a look first at what to do next so you know what to look for in above
Look down for data mapping - www.joomdle.com/wiki/Features
Please Log in or Create an account to join the conversation.
- Chaim Handler
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
11 years 8 months ago #7
by Chaim Handler
Replied by Chaim Handler on topic Baby Steps
In Data Mapping there is a list of moodle fields that can be mapped. They are:
address1, address2, city, region, country, postal_code, phone, website, favoritebook, aboutme, spacer, dob, tos.
First name and Last name are not on the list.
Also, you wrote that "By default Joomdle with parse the name field (if non of the above happens). So if you register John Doe in the name field in Joomla it will appears as John in the first name field in Moodle and Doe in the last name field in Moodle." I just added a user in Joomla with the name "joomdle test". In moodle both the first and last name fields for the user are empty. In fact the only field in the moodle user that was copied from joomla is the "username" field.
So either I have a problem in my installation or I'm doing something wrong. I'm going to try to use xdebug to figure out what's going on. Thanks again for your help.
address1, address2, city, region, country, postal_code, phone, website, favoritebook, aboutme, spacer, dob, tos.
First name and Last name are not on the list.
Also, you wrote that "By default Joomdle with parse the name field (if non of the above happens). So if you register John Doe in the name field in Joomla it will appears as John in the first name field in Moodle and Doe in the last name field in Moodle." I just added a user in Joomla with the name "joomdle test". In moodle both the first and last name fields for the user are empty. In fact the only field in the moodle user that was copied from joomla is the "username" field.
So either I have a problem in my installation or I'm doing something wrong. I'm going to try to use xdebug to figure out what's going on. Thanks again for your help.
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7902
11 years 8 months ago #8
by Antonio Durán
Replied by Antonio Durán on topic Baby Steps
> Secondly, I did need to make modifications because in moodle 2.7 the get_context_instance function was deprecated
Only if you enable debugging in Moodle. Otherwise it is ok. We have already changed these calls for next release.
> In moodle both the first and last name fields for the user are empty
Then you have a problem. Did you select None as addtional data source?
Only if you enable debugging in Moodle. Otherwise it is ok. We have already changed these calls for next release.
> In moodle both the first and last name fields for the user are empty
Then you have a problem. Did you select None as addtional data source?
Please Log in or Create an account to join the conversation.
- Chaim Handler
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
11 years 8 months ago #9
by Chaim Handler
Replied by Chaim Handler on topic Baby Steps
I traced what happens when I register a new user. The Joomla function "register()" in joomla\components\com_users\controllers\registration.php" triggers onUserAfterSave() in joomdlehooks.php. That routine invokes the services "user_id" followed by "create_joomdle_user". "create_joomdle_user" creates the user without data.
You have a routine called "save_user_info()" which would be invoked by the "create_joomla_user()" routine in users.php, and that routine would indeed divide the name into first and last name, and fill data fields including mapped fields.
Am I failing to understand something here?
You have a routine called "save_user_info()" which would be invoked by the "create_joomla_user()" routine in users.php, and that routine would indeed divide the name into first and last name, and fill data fields including mapped fields.
Am I failing to understand something here?
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7902
11 years 8 months ago #10
by Antonio Durán
Replied by Antonio Durán on topic Baby Steps
You did not say how you have set your "additional data source" option in Joomdle configuration.
Anyway: I have seen someone else making some mistake when making changes to joomdle code, which caused this problem. Check that you don't have a blank line at the end of any files.
You can use normal Joomdle code too. Just disable debugging in Moodle, and you are good to go.
Anyway: I have seen someone else making some mistake when making changes to joomdle code, which caused this problem. Check that you don't have a blank line at the end of any files.
You can use normal Joomdle code too. Just disable debugging in Moodle, and you are good to go.
Please Log in or Create an account to join the conversation.