New Blog Templates Plugin creates Error when Affiliate WP is enabled in Template

Hi guys,

this is a Repost of my reply to https://premium.wpmudev.org/forums/topic/blog-templates-create-site-raise-error#post-1056662 where I haven't got any reply...

It happens when trying to create a new site based of a template where Affiliate WP enabled (https://affiliatewp.com/).

The issue in more detail:

2016/03/30 20:46:43 [error] 10522#10522: *5266 FastCGI sent in stderr: "PHP message: WordPress-Datenbank-Fehler Incorrect table name 'wp_2_affiliate_wp_visits' für Abfrage CREATE TABLE IF NOT EXISTS wp_21_affiliate_wp_campaigns ('wp_2_affiliate_wp_visits'.'url') AS 'visits',count(distinct 'wp_2_affiliate_wp_visits'.'url') AS 'unique_visits',sum(if(('wp_2_affiliate_wp_visits'.'referral_id' <> 0),1,0)) AS 'referrals',round(((sum(if(('wp_2_affiliate_wp_visits'.'referral_id' <> 0),1,0)) / count('wp_2_affiliate_wp_visits'.'url')) * 100),2) von wpmu_create_blog, do_action('wpmu_new_blog'), call_user_func_array, blog_templates->set_blog_defaults, NBT_Template_copier->execute, NBT_Template_copier->copy_additional_tables" while reading response header from upstream, client: IP, server: DOMAIN.de, request: "POST /wp-admin/network/site-new.php?action=add-site HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/site.sock:", host: "DOMAIN.de", referrer: "DOMAIN/wp-admin/network/site-new.php"
The table "wp_21_affiliate_wp_campaigns" is a SQL VIEW. So it's no real table.

Let me know if you need anything in addition.

Brgds,

Jan