Hiya, I'm trying to copy some core edits (GDPR stuff) from my live site (1.5.6c) to a development store (1.5.7c) but im struggling to convert some array variables into a format that is acceptable to 1.5.7c with my limited knowledge of php.
The last 2 gdpr variables of this array need to be moved over to my new site, and i've done it like this which is obviously missing some important formatting as I cannot create a new account on the devstore and it throws up an error.
PHP Code:
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION,
'gdpr_accept' => $gdpr_accept,
'gdpr_accept_date' => date('Y-m-d H:i:s')
);
The way I added them to the array in 1.5.7c was like this, but I think I need the ('Y-m-d H:i:s') added but am unsure or the exact formatting of the line
PHP Code:
$sql_data_array = array(array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_lastname', 'value'=>$lastname, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_email_address', 'value'=>$email_address, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_nick', 'value'=>$nick, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_telephone', 'value'=>$telephone, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_fax', 'value'=>$fax, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_newsletter', 'value'=>$newsletter, 'type'=>'integer'),
array('fieldName'=>'customers_email_format', 'value'=>$email_format, 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_default_address_id', 'value'=>0, 'type'=>'integer'),
array('fieldName'=>'customers_password', 'value'=>zen_encrypt_password($password), 'type'=>'stringIgnoreNull'),
array('fieldName'=>'customers_authorization', 'value'=>$customers_authorization, 'type'=>'integer'),
array('fieldName'=>'gdpr_accept', 'value'=>$gdpr_accept, 'type'=>'integer'),
array('fieldName'=>'gdpr_accept_date', 'value'=>$gdpr_accept_date, 'type'=>'date'),
);
I also tried changing the last line to include the date formatting but I think I did it wrong as my login page would not even load.
PHP Code:
array('fieldName'=>'gdpr_accept_date', 'value'=>$gdpr_accept_date, 'type'=>'date('Y-m-d H:i:s')'),
--> PHP Fatal error: 1292:Incorrect datetime value: '' for column `thegluep_tg1`.`zen_customers`.`gdpr_accept_date` at row 1 :: INSERT INTO zen_customers (customers_firstname, customers_lastname, customers_email_address, customers_nick, customers_telephone, customers_fax, customers_newsletter, customers_email_format, customers_default_address_id, customers_password, customers_authorization, gdpr_accept, gdpr_accept_date, customers_gender) VALUES ('Susan', 'Flaps', '
[email protected]', '', '01202 820177', '', 0, 'TEXT', 0, '$2y$10$XiR0jqZoGg1cQ.kiON8iY.ORYkpKzCq91zc0RnEp3wwDIvBj1E26G', 0, 0, '', 'f') ==> (as called by) /home/thegluep/devstore.thegluepeople.co.uk/includes/modules/bootstrap/create_account.php on line 296 <== in /home/thegluep/devstore.thegluepeople.co.uk/includes/classes/db/mysql/query_factory.php on line 170.
Bookmarks