From: Roland Häder <roland@mxchange.org>
Date: Mon, 1 Oct 2012 20:07:25 +0000 (+0000)
Subject: Moved call of initExtraRegistrationSql() out of filter which caused trouble. Now... 
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1c7ab5872f957b374ce12c8994cc454e04a4a6ac;p=mailer.git

Moved call of initExtraRegistrationSql() out of filter which caused trouble. Now please don't forget it if you use the filter hook 'pre_user_registration'
---

diff --git a/inc/filter/register_filter.php b/inc/filter/register_filter.php
index 0120da91ee..ac93c916fa 100644
--- a/inc/filter/register_filter.php
+++ b/inc/filter/register_filter.php
@@ -104,9 +104,6 @@ function FILTER_PRE_USER_REGISTRATION_GENERIC ($filterData) {
 	$GLOBALS['register_country_row'] = '`country`';
 	$GLOBALS['register_country_data'] = substr(postRequestElement('cntry'), 0, 2);
 
-	// Init extra SQL data
-	initExtraRegistrationSql();
-
 	// Init "status" as for many users
 	setPostRequestElement('status', 'UNCONFIRMED');
 
diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php
index 3c750c2284..3a3d1f2dd3 100644
--- a/inc/libs/register_functions.php
+++ b/inc/libs/register_functions.php
@@ -294,6 +294,9 @@ function doUserRegistration () {
 		'init_done' => false
 	);
 
+	// Init extra SQL data
+	initExtraRegistrationSql();
+
 	// Run the pre-registration chain
 	$filterData = runFilterChain('pre_user_registration', $filterData);
 
@@ -506,24 +509,12 @@ function initExtraRegistrationSql () {
 
 // Add extra column for registration SQL
 function addExtraRegistrationColumns ($column) {
-	// Is it set?
-	if (!isset($GLOBALS['register_sql_columns'])) {
-		// Then initialize it
-		initExtraRegistrationSql();
-	} // END - if
-
 	// Add column
 	$GLOBALS['register_sql_columns'] .= $column;
 }
 
 // Add extra data for registration SQL
 function addExtraRegistrationData ($data) {
-	// Is it set?
-	if (!isset($GLOBALS['register_sql_data'])) {
-		// Then initialize it
-		initExtraRegistrationSql();
-	} // END - if
-
 	// Add column
 	$GLOBALS['register_sql_data'] .= $data;
 }