Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Myddleware not recognizing duplicate user #1107

Open
mjm2230 opened this issue Jan 4, 2024 · 12 comments
Open

Myddleware not recognizing duplicate user #1107

mjm2230 opened this issue Jan 4, 2024 · 12 comments

Comments

@mjm2230
Copy link

mjm2230 commented Jan 4, 2024

Hi,

I have a rule that maps a custom Salesforce object to Moodle users. The rule works great to create new users. However, it does not recognize users that already exist. I have username selected as my de-duplication field, yet existing users are not getting skipped (this is a create rule, not create and update) as I would expect and have seen before when using Myddlware. They're throwing an invalid parameter error (see below).

image

Is this expected behavior?

@Myddleware
Copy link
Owner

Hi @mjm2230 ,
It should detect the user that already exists, could you send us a screenshot of your rule, the detail view with the first tab (information) ?
Thanks.

@mjm2230
Copy link
Author

mjm2230 commented Jan 4, 2024

Hi @Myddleware ! Here is the information tab:

image

@Myddleware
Copy link
Owner

Hi @mjm2230 ,
Thanks for you screenshots.
We have tried to reproduce the issue. We saw it can happen when the Salesforce field mapped into Moodle username field doesn't contains exactly an existing username in Moodle.

Could you make sure the data in username (target values) exists in Moodle. Here is what we have tested and the username sfaure110 has been found in Moodle so the document is set from type C (CREATE) to type U (UPDATE) :
image
So it works properly on our side.

Please if it still doesn't work. Vould you send us a screenshot of you document and the corresponding user in Moodle ? Thanks.

Even if you find a solution with the username, we have a bug which is already fixed but not deploy yet. In case a record is found after duplicate search, the document is set to UPDATE and will be send event if the rule has the mode CREATE ONLY. We will deploy the fix in the next version but you can change manually the code of documentManager.php using this commit if you want :
196e6e1

@mjm2230
Copy link
Author

mjm2230 commented Jan 5, 2024

Hi @Myddleware,

Thanks for exploring this for me! It seems like the data exactly matches the existing Moodle user. Here is an example:

image

image

image

Do you think that if I manually change the code as you suggest that will fix this issue?

@Myddleware
Copy link
Owner

Hi @mjm2230,
Maybe there is a bug with the "-" in the username. Do you have a case without the "-" ?

If you change manually the code, it won't fix the issue on the username detection. The fix will just cancel the document if a username if found (document type is then set to U (UPDATE)) and if the rule type is CREATE ONLY.

@mjm2230
Copy link
Author

mjm2230 commented Jan 9, 2024

Hi @Myddleware ! Darn -- nope, the issue replicates with all existing usernames, even ones with no special characters:

image

@Myddleware
Copy link
Owner

Thanks @mjm2230 ,

We can't reproduce the issue. Could you give me your version of Myddleware (you can see it in the footer) ?

@mjm2230
Copy link
Author

mjm2230 commented Jan 9, 2024

@Myddleware Thanks for trying. We're using 3.3.4a

@Myddleware
Copy link
Owner

Hi @mjm2230,
OK so you have the latest version and we tryed to reproduce it on this version too.

Are you developer ? If yes, I could give you some tips to debug this issue. Otherwise we could debug it for you but this is a "not free" support service.

@mjm2230
Copy link
Author

mjm2230 commented Jan 10, 2024

Hi @Myddleware,

I am not a developer. I'd be happy for you to debug it for "not free" :) Let me know how we can arrange that!!

@Myddleware
Copy link
Owner

Hi @mjm2230 ,
You contact me using the address email displayed on my github profile (I have just made it public).
Have a nice day.

@mjm2230
Copy link
Author

mjm2230 commented Jan 10, 2024

@Myddleware Emailing you now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants