Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
(running hostmaster 6.x-1.1 - I don't see that choice in dropdowns...)
I've enabled client support in aegir, and am now attempting to import a site alias created from provision-save. It looks like the client object is being passed to mysqli_real_escape_string(), resulting in an error:
[aegir@host ~]$ drush provision-save @jktestcom --context_type=site --uri='jktest.com' --platform='@platform_jktestcom' --client_email='jlkinsel@yahoo.com' --client_name='jlkinsel@yahoo.com' --db_server='@server_localhost'
[aegir@host ~]$ drush @hostmaster hosting-import @jktestcom
WD php: mysqli_real_escape_string() expects parameter 2 to be string, object given in
/var/aegir/hostmaster-6.x-1.0/includes/database.mysqli.inc on line 330. [error]
mysqli_real_escape_string() expects parameter 2 to be string, object given in /var/aegir/hostmaster-6.x-1.0/includes/database.mysqli.inc
on line 330. [warning]
Content of site and platform definitions:
[aegir@host ~]$ cat .drush/jktestcom.alias.drushrc.php
<?php
$aliases['jktestcom'] = array (
'context_type' => 'site',
'platform' => '@platform_jktestcom',
'server' => '@server_master',
'db_server' => '@server_localhost',
'uri' => 'jktest.com',
'root' => '/home/jail/./home/jktest/public_html',
'site_path' => '/home/jail/./home/jktest/public_html/sites/jktest.com',
'site_enabled' => true,
'language' => 'en',
'client_name' => 'my@email.com',
'aliases' =>
array (
),
'redirection' => false,
'profile' => 'default',
);
[aegir@hosting1 ~]$ cat .drush/platform_jktestcom.alias.drushrc.php
<?php
$aliases['platform_jktestcom'] = array (
'context_type' => 'platform',
'server' => '@server_master',
'web_server' => '@server_master',
'root' => '/home/jail/./home/jktest/public_html',
'makefile' => '',
);
Here's a trace leading up to the error:
db_escape_string(Object:stdClass) # line 224, file: /var/aegir/hostmaster-6.x-1.1/includes/database.inc
_db_query_callback(Array[2]) # line 0, file: unknown
preg_replace_callback("/(%d|%s|%%|%f|%b|%n)/", "_db_query_callback", "SELECT c.nid FROM hosting_client c JOIN node n ON c.nid = n.nid ...") # line 40, file: /var/aegir/hostmaster-6.x-1.1/includes/database.mysql-common.inc
db_query("SELECT c.nid FROM {hosting_client} c JOIN {node} n ON c.nid = n....", Object:stdClass) # line 125, file: /var/aegir/hostmaster-6.x-1.1/profiles/hostmaster/modules/hosting/client/hosting_client.module
hosting_get_client(Object:stdClass) # line 170, file: /var/aegir/hostmaster-6.x-1.1/profiles/hostmaster/modules/hosting/site/hosting_site.nodeapi.inc
hosting_site_update(Object:stdClass, null, null, null) # line 659, file: /var/aegir/hostmaster-6.x-1.1/modules/node/node.module
node_invoke(Object:stdClass, "update") # line 937, file: /var/aegir/hostmaster-6.x-1.1/modules/node/node.module
node_save(Object:stdClass) # line 124, file: /var/aegir/hostmaster-6.x-1.1/profiles/hostmaster/modules/hosting/hosting.drush.inc
hosting_drush_import("@jktestcom") # line 78, file: /var/aegir/hostmaster-6.x-1.1/profiles/hostmaster/modules/hosting/hosting.drush.inc
drush_hosting_import("@jktestcom") # line 0, file: unknown
call_user_func_array("drush_hosting_import", Array[1]) # line 120, file: /var/aegir/drush/includes/command.inc
drush_invoke_args("hosting-import", Array[1]) # line 58, file: /var/aegir/drush/includes/command.inc
drush_invoke("hosting-import", "@jktestcom") # line 0, file: unknown
call_user_func_array("drush_invoke", Array[2]) # line 721, file: /var/aegir/drush/includes/command.inc
drush_command("@jktestcom") # line 0, file: unknown
call_user_func_array("drush_command", Array[1]) # line 204, file: /var/aegir/drush/includes/command.inc
drush_dispatch(Array[22]) # line 101, file: /var/aegir/drush/drush.php
drush_main() # line 41, file: /var/aegir/drush/drush.php
I'm not sure if this is an issue to address in hosting_site_update() or hosting_get_client() - at line 122 in hosting_client.module I added...
elseif (is_object($client)) {
return $client;
Which I think fixed this, but I'm having other issues, so not positive...
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedBingo!
Thanks for the excellent bug report. This bug exists in the latest version of Aegir too.
Note that:
In
hosting_import_site
we do this:But in
hosting_site_drush_context_import
we do this:We should do one or the other eh?
Comment #2
Steven Jones CreditAttribution: Steven Jones commentedFix was painfully simple:
http://drupalcode.org/project/hostmaster.git/commitdiff/463d03fe70a3b80d...
Thanks for the bug report again!