Pro Sites doesn't remember the selected template.

The Pro Sites doesn't remember which template user has just chosen previously during the signup process. After logging in, the new site starts afresh with the Twenty Fifteen theme as a default with no sign of copying all the settings and content from template site (see attached for New Blog Templates setting). My first and foremost attempt for now is testing the New Blog Templates and Pro Sites plugins as a normal user / subscriber / customer, with the previous Pro Sites version (a couple of months back) I could be able to achieve this flow as intended.

--> At the Template Page (the collection has been controlled by New Blog Templates)
--> Click "Choose this design"
--> Registration Signup + FORCE user to check over "Create a Site" at the same time as giving their site a name, alias = subdomain name. When the "Create a Site" checkbox doesn't get checked, the registration process is not successful.
--> Activate their signup through the link sent via email.
--> Login to their site.
--> After login, redirected to WP Dashboard
--> The chosen template awaits for alteration over the dashboard.

The first task, registration during the free trial period, seemed to be pretty basic and was successful as intended but after several upgrades on your Pro Sites plugin, I just have a chance to double check with the flow and many problems arise as follows:

--> At the Template Page
--> Click "Choose this design": using either of both links below giving me the same result which brings me to this particular page (see attached for screenshot)
http://TheSiteName.com/pro-site/?action=new_blog
http://TheSiteName.com/register/?blog_template=X
--> There are no plans available for me to choose from or subscribe as you can see from the sceencap.
--> Click "No thank you, I will continue with the basic site for now."
--> The site registration process with creating a username and sitename (THIS NEW UPGRADE OF PRO SITES BLOWS MY MIND - nice touch and looks less complicated.)
--> Click "LOGIN", bring me to the WP Dashboard BUT WITHOUT the selected template awaits.

The site is still under the dev local machine, I'll have another question regarding domain mapping after the sitename (subdomain) has been chosen during the signup but I'll put this topic on a different thread. Please advice on the issues above.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Cas,

    Sorry to hear of the problem you are having.

    This can be due to plugin/theme conflict on your site.

    You can just try on your development site temporary using default WordPress theme like Twenty Fifteen and temporary deactivating all other plugins except Pro sites & New blog template and activating them one by one as displayed in the following flowchart to know which theme/plugin is conflicting if any.

    https://premium.wpmudev.org/manuals/getting-support/

    Kind Regards,
    Vinod Dalvi

  • Code Injector
    • The Incredible Code Injector

    The Pricing Table in the Pro Sites not showing up was just sorted. I had to delete all the previous Pro Sites Plans and set them all up again, that pulls all the plans right back to the front-end as usual.

    About the template content and setting didn't get copied when selected, was your suggestion to deactivate most plugins meant for this issue? Is the setting above OK?

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    I'm searching for similar issues in our bug tracker, but there is none. I will setup environment and test it.
    Can you tell me if the template is not remembered when you choose "No thank you, I will continue with the basic site for now" and if you choose levels (it not working with both choices)?

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    I've just had another test on the issues.

    Can you tell me if the template is not remembered when you choose "No thank you, I will continue with the basic site for now"

    No, it didn't remember the template I chose.

    if you choose levels (it not working with both choices)?

    No, it also didn't remember the template I chose. The test payment went well with the Sandbox but couldn't be able to purchase a new plan, upgrade or downgrade when attempting to make the 2nd payment.

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    I tried to replicate this issue on my test multisite, but everything worked as expected. I've tested two cases:
    - choosing template on signup page (under the form with the username and page name)
    - choosing template on separate page and then going to the registration page (http://TheSiteName.com/pro-site/?blog_template=X)
    Every time template was remembered and new page was created with non default theme with all the content (pages and posts).
    I noticed that on your screen the template doesn't have Pages and Posts ticked.
    Can you try in settings of the New Blog Templates select that choosing template will be at the signup page? Just for test purposes.
    If this not work is there a possibility, that you could copy your network and get in on-line, so we could get closer look on this issue?

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    Hi Kasia,

    The problem is from what I've noticed, the blog_id (template site id) doesn't get sent through the url. I ran the test like you suggested with no success. What I did are below:

    1. Try changing the setting on Fixer theme (screenshot attached).
    2. On Template Collection page -> click "Choose this template"
    3. Brought to the "Pro Site Setting #3 Result (screenshot attached)" page WITH THIS URL "http://TheSiteName.com/pro-site/?action=new_blog" << no sign of blog_id given.
    4. Register went well to "Login (screenshot attached)"
    5. Login with the default theme "Twenty Fifteen" waiting NOT the Fixer theme as meant to be.

    As the site and the content are around 10GB in total, I have another severe issues which cannot bring the site to the real server now for you to see until they get sorted as you could see from its size total that it's quite a pain. Please advice and bear with me.

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    I've made another test - I disabled and enabled all the plugins on the multisite and I got almost similar results as you:
    - template is not remembered when the it is chosen from the separate page - the template id is not in the url;
    - the template is saved when it is chosen from the same page as the pricing table.

    Strange I did get different results in previous tests, but with clean environment it stopped working.

    But you are right and I'm marking this as a bug. I will mark both developers to check that issue.

    Kind regards,
    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    Please upload attached file (first unzip it) to the mu-plugins folder in wp-content directory - if there is no mu-plugins, then create it.
    I've tested this code and it fixes the issue with new blog templates. Please confirm if this is working also for you.

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    I had a very high hope on this fix but sadly, Kasia, it didn't work. Just to make sure I've done everything right, I placed your file here
    >> /wp-content/mu-plugins/wpmudev_fix_templates.php

    At first, I thought it might be because of my modified blogtemplates.php, then I switched the whole plugin folder to its latest original version yet still didn't work and no sign of blog_id sending via URL. On the previous working version up until Pro Sites 3.5.0.4, when user was brought to the signup page (already chosen their template from the proper template showcase page), I could see the "http://TheSiteName.com/pro-site/?blog_template=X" was sent via URL to the signup page but the same approach doesn't seem to be applied to the current version.

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    Yes, the /wp-content/mu-plugins is correct path. I'm checking this with Version 3.5.1.3 of Pro Sites and Version 2.7.9 of New Blog Templates.
    I have separate page for the templates. When choosing template I'm redirected to url http://mysite.com/pro-site/?blog_template=5&action=new_blog (see the video from my test site http://quick.as/GG3QC91nG)
    Can you go to the plugins list and see if this small plugin is there in the "Must-Use" plugin? Check if it has proper permissions - 644.
    Can you try to test it on different browser, with cleared cache?
    If this not help, can you put code directly in the functions.php of theme that you use?

    add_filter( 'psts_setting_checkout_url', 'katarzyna_nbt_pro_sites_checkout_url' );
    function katarzyna_nbt_pro_sites_checkout_url( $value ) {
    	global $pagenow, $psts;
    	if ( ! is_object( $psts ) )
    		return $value;
    	$show_signup = $psts->get_setting( 'show_signup' );
    	if ( ! is_admin() && 'wp-signup.php' == $pagenow && $show_signup && isset( $_REQUEST['blog_template'] ) ) {
    		$value = add_query_arg( 'blog_template', $_REQUEST['blog_template'], $value );
    	}
    	return $value;
    }

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    Yes, the /wp-content/mu-plugins is correct path. I'm checking this with Version 3.5.1.3 of Pro Sites and Version 2.7.9 of New Blog Templates.

    I have the same version of both plugins activated.

    I have separate page for the templates. When choosing template I'm redirected to url http://mysite.com/pro-site/?blog_template=5&action=new_blog (see the video from my test site http://quick.as/GG3QC91nG)

    I am still struggling at the same old issue. After several tests, still redirected to http://MySite.com/pro-site/?action=new_blog no sign of "?blog_template=X" passing through the url. I couldn't see your video, it says "Oh! it's a 404".

    Can you go to the plugins list and see if this small plugin is there in the "Must-Use" plugin? Check if it has proper permissions - 644.

    #1 Put the plugin here /wp-content/mu-plugins/wpmudev_fix_templates.php - didn't work.
    #2 Put the code here /wp-content/mu-plugins/functions.php - didn't work.
    #3 Put the code in /wp-content/themes/child-theme/functions.php - didn't work.

    Can you try to test it on different browser, with cleared cache?

    I always have Chrome, Firefox, and Safari running at the same time and always clear the cache.

    If this not help, can you put code directly in the functions.php of theme that you use?

    Done that, above and not working. Please advice.

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    Is there any chance that we could see this site online? Staging site, with just plugins, themes, no content?
    We tested this on two different multisites - with mu-plugin, in the functions.php, both worked.
    Can you enable debug mode? Maybe there is error that will show why this is not working.
    To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', true );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

    Also, test it please without any other plugins if this is possible.

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    I have your code in /wp-content/mu-plugins/functions.php, I've got these:

    [15-Oct-2015 15:20:22 UTC] PHP Notice: Undefined index: blog_template in C:\path-to\wp-content\plugins\blogtemplates\blogtemplatesfiles\blog_templates.php on line 452

    [15-Oct-2015 15:20:22 UTC] PHP Notice: Undefined index: blog_template in C:\path-to\wp-content\plugins\blogtemplates\blogtemplatesfiles\blog_templates.php on line 468

    [15-Oct-2015 15:20:25 UTC] PHP Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in C:\path-to\wp-includes\functions.php on line 3622

  • Kasia Swiderska
    • Support nomad

    Hello Cas,

    So the PHP version is OK (it's not low). Info from debug.log shows only notices not errors. Here is new beta for Pro Sites https://dl.dropboxusercontent.com/u/152848/pro-sites-20151015-01.zip and I've tested it with code fix added to the functions.php of theme I'm using on my main site, can you try with this one?
    (Please note, that this is beta, so make a backup before trying).
    If this not help, then I really need access to your environment - I could try to bring developer to check why this is not working, but he will ask for access.

    Kind regards,
    Kasia

  • Code Injector
    • The Incredible Code Injector

    Hello Kasia,

    No, it still doesn't work. I have upgraded to the official Pro Sites v3.5.1.4 and put the code given above in my child-theme functions.php, not working. Testing again by removing the given code above off from functions.php, only having the latest Pro Sites now = Not working.

    The site can't be uploaded for a test run yet because the size is around 10GB, not until this bit and domain mapping issue will get resolved. Please help and advice further as I'm already in hell now.

  • Code Injector
    • The Incredible Code Injector

    Hello Ashok,

    Yes, indeed the New Blog Template update can fix it!!!!!!!! I can't tell you enough how utterly happy I am at the moment. Thank you very very much to WPMUDEV team, Kasia, and to you too.
    One last question, due to the structure of the link changed on the new update, I have this old one below all over on custom buttons.

    http://MainSite.com/register/?blog_template=X

    Should I search and replace it in the DB and put this one instead or any other recommended solutions?

    http://MainSite.com/pro-site/?action=new_blog&blog_template=X

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.