when installing all at the same time i have this error :

Fatal error: Call to undefined function support_active_clients() in /var/www/sites/all/modules/support_fields/support_fields.install on line 16

Comments

span’s picture

Could you please tell me what version of the support module you are using as well?

ssm2017 Binder’s picture

the support version i am using is 6.x-1.3
when installing "support" then installing your module all is fine
the problem is when im trying to enable all at the same time
this is calling the function but the module is not yet installed
maybe you should use a test to check if the function is available or use "requirements" to force people install "support" before installing your module

span’s picture

Status: Active » Needs work

Ah, thank you for an excellent description of the problem. This will make it easy to fix. If you have a patch you are more then welcome to post it otherwise I will look into this next week.

Thank you for your report.

span’s picture

Status: Needs work » Needs review

Commited a change to dev version which is not available in the Beta atm. A fix is either to make sure the support module is installed and activated before enabling the add-on. Another fix is changing the hook_install from this:

/**
*	Implementation of hook_install() to add variables
*/
function support_fields_install() {
	$type = content_types('support_ticket');
	$clients = support_active_clients();
	foreach($type['fields'] as $fields => $field) {
		foreach($clients as $clid => $client) {
			variable_set('support_fields_' . $client->clid . '_' . $field['field_name'], FALSE);
		}
	}
}

To this:

/**
*	Implementation of hook_install() to add variables
*/
function support_fields_install() {
  // Load support.module from the node module.
  module_load_include('module', 'support', 'support');
	$type = content_types('support_ticket');
	$clients = support_active_clients();
	foreach($type['fields'] as $fields => $field) {
		foreach($clients as $clid => $client) {
			variable_set('support_fields_' . $client->clid . '_' . $field['field_name'], FALSE);
		}
	}
}
span’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.