Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The only fields passed from Drupal to Discourse in discourse_sso_validate() are currently user ID, username and email. Discourse supports custom fields (https://meta.discourse.org/t/custom-user-fields-for-plugins/14956) and in some cases it might be desired to send additional info from Drupal to Discourse. Examples could be anything from passing user name to subscription settings.
I don't see any hook at the moment that would allow to append to return payload unless I am missing something?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2635042-5.patch | 1.15 KB | Charlotte17 |
#2 | custom_fields-2635042-2.patch | 1.29 KB | nonsie |
Comments
Comment #2
nonsieSomething like attached patch should suffice. And then in your own custom module you can have something like this:
Comment #3
firewaller CreditAttribution: firewaller commentedThis is great!
Just as a note for anyone else using this, when passing boolean values, use 'true' or 'false' (with quotes) and not: TRUE, FALSE, true, false, 1, 0
ie.
$payload['admin'] = 'true';
Comment #4
Charlotte17 CreditAttribution: Charlotte17 at MTech, LLC commentedThis should be a drupal_alter instead of module_implements.
Comment #5
Charlotte17 CreditAttribution: Charlotte17 at MTech, LLC commented