Error message

You are not authorized to post comments.

If you log into devshop as an authenticated user, when you have all the right "create site permissions", you get a big ugly error message on the site create form:

Your user is not associated with any clients so you are not allowed to create new sites

Turns out this isn't actually true. Submit the form, it works normally.

The form_set_error() was called from inside a function that's being used to return the #default_value of the client field! No validation is happening at all.

Turns out the code for client field is in hosting_site, it should be in hosting_client.

I don't know who actually uses this feature, since it's actually broken, but this patch preserves the assumed functionality, and adds a new setting to the clients page:

Require users to have a client to create a site.
If this setting is on, users will not be able to create sites unless they are associated with a client.

It defaults this setting to "Off", but runs an update hook to preserve existing aegir sites behavior.

Let me know if you think this is even a feature we should have, considering it never actually prevented users from submitting sites in the first place.

CommentFileSizeAuthor
#4 3018114-client-optional.patch4.62 KBJon Pugh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh created an issue. See original summary.

Jon Pugh’s picture

Wait, this doesn't actually seem to prevent the users from submitting a site at all.

:|

The warning message is pretty loud, though and I want to get rid of it without granting access to "administer clients" permissions.

  • Jon Pugh committed e4de7a6 on 3018114-client-optional
    Issue #3018114: Allow users without a client to create a site if there...
Jon Pugh’s picture

Status: Needs work » Needs review
FileSize
4.62 KB

Yeah I see what's happening now.

That warning "Your user is not associated with any clients so you are not allowed to create new sites"

is triggered from a call from the #default_value field! So it doesn't fire at all on submit.

I had no choice, I had to refactor this, despite the fact that I've never used Clients before. This is the first step in making clients NOT required.

Jon Pugh’s picture

Category: Feature request » Bug report
Priority: Normal » Major

Definitely a bug. It tells the user "You can't create a site" but they certainly can!

Marking major as it doesn't respect access control.

Jon Pugh’s picture

Issue summary: View changes
Jon Pugh’s picture

helmo colan ergonlogic?

Jon Pugh’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +devshop patches

RTBC by DevShop

Jon Pugh’s picture

Status: Reviewed & tested by the community » Fixed

  • Jon Pugh committed e4de7a6 on 7.x-3.x
    Issue #3018114: Allow users without a client to create a site if there...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.