Commit 4969b65e authored by Steven Jones's avatar Steven Jones

Issue #1358768 by Steven Jones: Fixed 6.x-1.6 generates multiple Undefined...

Issue #1358768 by Steven Jones: Fixed 6.x-1.6 generates multiple Undefined property errors on site import.
parent 2e0568c0
......@@ -45,8 +45,8 @@ function hosting_clone_post_hosting_clone_task($task, $data) {
$clone->platform = $target;
$clone->import = 1; # make sure the site doesn't reinstall...
$clone->verified = 0; # ... and it does verify
$clone->aliases = $task->task_args['aliases'];
$clone->redirection = $task->task_args['redirection'];
$clone->aliases = isset($task->task_args['aliases']) ? $task->task_args['aliases'] : array();
$clone->redirection = isset($task->task_args['redirection']) ? $task->task_args['redirection'] : FALSE;
if ($clone->db_server != $task->task_args['new_db_server']) {
$clone->db_server = $task->task_args['new_db_server'];
......@@ -67,4 +67,3 @@ function hosting_clone_post_hosting_clone_task($task, $data) {
hosting_site_post_hosting_backup_task($task, $data);
}
}
......@@ -25,7 +25,7 @@ function _hosting_ip_list($addresses) {
* Display the ip address on the node. IP utility function for hook_view.
*/
function hosting_ip_view(&$node) {
$ip_list = _hosting_ip_list($node->ip_addresses);
$ip_list = isset($node->ip_addresses) ? _hosting_ip_list($node->ip_addresses) : array();
if (sizeof($ip_list)) {
$node->content['info']['ip_addresses'] = array(
......@@ -90,4 +90,3 @@ function hosting_ip_delete($node) {
function hosting_ip_delete_revision($node) {
db_query("DELETE FROM {hosting_ip_addresses} WHERE vid=%d", $node->vid);
}
......@@ -144,12 +144,14 @@ function hosting_site_insert(&$node) {
$node->site_language = ($node->site_language) ? $node->site_language : 'en';
// If the cron_key is set use it, otherwise generate a new one.
$node->cron_key = !empty($node->cron_key) ? $node->cron_key : '';
// Ensure that the last_cron value is set.
$node->last_cron = isset($node->last_cron) ? $node->last_cron : 0;
hosting_ip_save($node, FALSE);
db_query("INSERT INTO {hosting_site} (vid, nid, client, db_server, platform, profile, language, last_cron, cron_key, status, verified) VALUES (%d, %d, %d, %d, %d, %d, '%s', %d, '%s', %d, %d)",
$node->vid, $node->nid, $node->client, $node->db_server, $node->platform, $node->profile, $node->site_language, $node->last_cron, $node->cron_key, $node->site_status, $node->verified);
if ((!$node->old_vid)) {
if ((empty($node->old_vid))) {
hosting_context_register($node->nid, ($node->hosting_name) ? $node->hosting_name : $node->title);
if ($node->import) {
hosting_add_task($node->nid, 'import');
......
......@@ -579,6 +579,8 @@ function hosting_available_tasks($type, $reset = FALSE) {
* Implementation of hook_insert().
*/
function hosting_task_insert($node) {
$node->executed = isset($node->executed) ? $node->executed : NULL;
$node->executed = isset($node->delta) ? $node->delta : NULL;
db_query("INSERT INTO {hosting_task} (vid, nid, task_type, task_status, rid, executed, delta) VALUES (%d, %d, '%s', %d, %d, %d, %d)",
$node->vid, $node->nid, $node->task_type, $node->task_status, $node->rid, $node->executed, $node->delta);
......
......@@ -183,6 +183,12 @@ function hosting_ssl_nodeapi_site_validate($node, &$form) {
}
function hosting_ssl_nodeapi_site_presave(&$node) {
if (!isset($node->ssl_key)) {
$node->ssl_key = HOSTING_SSL_CUSTOM_KEY;
}
if (!isset($node->ssl_enabled)) {
$node->ssl_enabled = HOSTING_SSL_DISABLED;
}
if ($node->ssl_key == HOSTING_SSL_CUSTOM_KEY) {
$node->ssl_key = hosting_ssl_filter_key($node->ssl_key_new);
}
......@@ -222,7 +228,7 @@ function hosting_ssl_nodeapi_site_delete_revision($node) {
* Store the SSL Cert key in the database.
*/
function hosting_ssl_save_key($key, $ssl_enabled = TRUE, $client = null) {
if (!$ssl_enabled) {
if (empty($ssl_enabled)) {
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment