PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Creating a new site in WP MS

  1. I am trying to use the User Registration addon to create a new site in WP MS. It seems that the addon adds the newly registered user to the main site, but the WP function wp_install_defaults() does this as well. The result is that the newly created user shows up in the table that lists the sites (Network admin->Sites) two times. However, the new user does NOT show up 2x in the user table (Network admin->Users). I have worked around this by creating a custom install.php in the wp-content folder that replaces the WP function wp_install_defaults(), and then commenting out the lines that duplicate the user in the site table.

    Is this a bug in the User Registration add on? It would seem that if I'm right about the WP behavior, the User Registration addon shouldn't add the user to the sites table. Or is this the intended behavior?

    Also, I posted a question here that has gone unanswered:
    http://www.gravityhelp.com/forums/topic/creating-new-sites-in-a-network-after-taking-payment

    I'm no longer interested in getting answers to all of those questions, but I am still wondering how to get the numeric site ID of the site created by the user registration add on. Does anyone know where I can find that info?

    Posted 12 years ago on Tuesday January 17, 2012 | Permalink
  2. Hi John,

    I'm not clear on the issue with the issue showing up twice. Do you mean to say that he shows up on the main site and the newly created site or that he shows up twice under the newly created site? Currently the User Registration add-on adds the user both the main site and the newly created site. An upcoming version of the User Registration add-on will allow you to specify whether or not the user should be created on the main site.

    I've added a new hook to the User Registration Add-on:

    http://www.gravityhelp.com/documentation/page/Gform_site_created

    This will allow you to more readily obtain the site ID of the newly created site. If you email me at david@rocketgenius.com, I will send you the updated version of the User Registration Add-on.

    Posted 12 years ago on Wednesday January 18, 2012 | Permalink
  3. Thanks, David. I will send you an email.

    As for clarification of the issue, the problem is that in the usermeta table, there ends up being 2 capabilities for the new user on the main site, such as {prefix}_capabilities. The {prefix}_{siteid}_capabilities (ie, the new site) just has 1 entry as administrator. For the main site, there are 2 capability entries for subscriber, which is the role consistent with my setting, but there should be only 1.

    I suspect that the standard wp function wp_install_defaults() adds the capability for the main site when a site is created, and perhaps the addon does the same thing, resulting in a dupe.

    {prefix}_user_level is also duplicated, but no other fields in usermeta appear to be duplicated when a site is created.

    When the capabilities are duplicated, the user ID appears 2x on the site list, even though the user only appears 1x in the user list.

    Does that clarify things?

    Posted 12 years ago on Thursday January 19, 2012 | Permalink
  4. Hi John,

    I have been unable to replicate this issue. It is possible this was inadvertently resolved in some of the upcoming changes to the User Registration issue. When you email me for the updated version, could you confirm if the issue is still occurring?

    Posted 12 years ago on Thursday January 19, 2012 | Permalink
  5. David, I tested version .20, and after creating 2 sites, I can't reproduce the error, so it seems this was resolved between version .15 and .20.

    Thanks for your assistance.

    Posted 12 years ago on Saturday January 21, 2012 | Permalink
  6. Glad to help. :)

    Posted 12 years ago on Wednesday February 1, 2012 | Permalink

This topic has been resolved and has been closed to new replies.