1. User exists on the master site, but not yet on a slave site.
2. On the slave site, an admin wants to add a user to a group or assign node ownership.
3. Bakery should go ahead and request the account so it can be used.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Status: Active » Needs work
FileSize
1.5 KB

Initial version which looks for user fields with #autocomplete_path === user/autocomplete. Overriding the autocomplete itself would be nice. Needs testing.

coltrane’s picture

Hmmn, I don't really like it attaching to every autocomplete, seems to add unnecessary overhead. One way to lessen it would be to check user_access() for the admin bakery permission.

I was wondering about a form option for requesting, which, turns out, you have at #1033322: Pull account form for admins.

I kind of want to separate the SSO and the synchronizing of data in Bakery, let me think on this some more and try and get some specifics out.

drumm’s picture

FileSize
2.08 KB

This patch remembers which form_ids are altered. Forms without user autocomplete fields are ignored after the first time.

drumm’s picture

Status: Needs work » Needs review
FileSize
6.11 KB

And here is a patch that which adds a fortune cookie exchange for autocompletion. Fortune cookies probably originate from San Francisco, where I live, and attempt to give advice, like autocomplete.

coltrane’s picture

Status: Needs review » Needs work
+++ bakery.module	26 Jan 2011 01:02:48 -0000
@@ -1286,6 +1377,56 @@ function bakery_eat_gingerbread_cookie()
+    watchdog('!', print_r($cookie, TRUE));

Leftover debug, and another two lines later.

The patch works. I created an account on my master site, then went to the slave site and using the Authored by autocomplete on the node_add form could get that user to appear. After submitting the node that user account existed on the slave site.

I don't think every Bakery site is going to want this functionality, especially available to every user with 'access user profiles' permission. If the whole use case was behind a variable it would at least help these users and not make an ever-growing bakery_user_forms variable with form IDs.

Neil, one of the drupal.org use case is association.drupal.org/intranet, right? Allowing group admins to add people to groups who don't yet have an account on the association intranet?

drumm’s picture

FileSize
6.93 KB

This patch fixes both issues.

Yes, association.drupal.org/intranet is exactly the use case.

drumm’s picture

Status: Needs work » Needs review
greggles’s picture

Re-rolled.

I'm not sure this is necessary/appropriate:

if (count($matches) < 10) {

On a site with a lot of matches it is likely that you'll get 10 but still not the one you want. I guess users can keep typing, but personally I'd rather get the list from both sides sooner.

The idea of remembering which forms need this is interesting. Did you see a performance hit from going deep into a complex form? That seems like it should be quick while the downside (a huge variable of form_ids) could be painful. I also wonder how well this will work given form_ids are sometimes re-used (I think the node/add/blog form and the admin/content/node-type/blog forms use the same form ID and do not match each other in terms of using an autocomplete).

drumm’s picture

Thanks to #1211474: Set dev sites up for bakery testing, I should be able to take another look at this, along with anyone else on the dev sites.

coltrane’s picture

Status: Needs review » Needs work

CNW?

greggles’s picture

Status: Needs work » Needs review

Which part NW?

My criticisms in #8 could be fixed later if we find they are problems. Let's do eeet.

coltrane’s picture

I interpreted "I should be able to take another look at this, along with anyone else on the dev sites." as drumm thinking it needed work still. But on reread it does just sound like testing.

drumm’s picture

Status: Needs review » Needs work

I'm guessing this patch needs a reroll. It is still important, but can wait until the next release cycle.

greggles’s picture

It applies fine to 6.x-2.x, actually. The re-roll is only necessary for the 7.x-2.x branch.

drumm’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Issue tags: +prague2013

The use case we're running into now is the Speaker(s) field for session submission. If the co-presenter hasn't used the site yet, they aren't available for autocompletion. In this case, we could hook into the field system instead of scanning through the whole form.

drumm’s picture

Assigned: drumm » Unassigned
Issue summary: View changes