From 23cc3cff443ac0f23834828455918f730baef144 Mon Sep 17 00:00:00 2001
From: Kevin Cristiano <kcristiano@tadpole.cc>
Date: Fri, 8 Jun 2018 07:05:48 -0400
Subject: [PATCH] CRM-21812 - don't specify installation type post install

props @MegaphoneJon
The wp-cli-login-server plugin checks for the presence of elements in the $_GET array, and fails if any are found. This conflicts with CiviCRM, which places:

$_GET['civicrm_install_type'] = 'wordpress';

into every page load.

I confirmed that this value is only used for install, and placed a conditional around it to only insert pre-install. I successfully installed CiviCRM and engaged in normal use with the conditional applied, and confirmed that this fixed the WP plugin.

This is intended to close aaemnnosttv/wp-cli-login-command#24.

Signed-off-by: Kevin Cristiano <kcristiano@tadpole.cc>
---
 civicrm.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/civicrm.php b/civicrm.php
index 19311202bf..e08db8faf3 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -309,7 +309,9 @@ class CiviCRM_For_WordPress {
     if ( $this->civicrm_in_wordpress() ) {
       // this is required for AJAX calls in WordPress admin
       $_GET['noheader'] = TRUE;
-    } else {
+    }
+
+    if ( !CIVICRM_INSTALLED && !$this->civicrm_in_wordpress() ) {
       $_GET['civicrm_install_type'] = 'wordpress';
     }
 
-- 
GitLab