1

I have a drush command I am using to convert field_collection to multifield.

/**
 * Convert Field Collection to Multifield.
 */
function mvpd_update_7018() {
  module_load_include('inc', 'multifield', 'multifield.drush');
  $field_collections = array(
    'field_brand_app_logos',
    'field_brand_resource',
    'field_mvpd_app_logos',
    'field_mvpd_authz_messages',
  );
  foreach($field_collections as $field_collection) {
    drush_multifield_convert_field_collection($field_collection);
  }
}

I get the error:

'call_user_func_array() expects parameter 1 to be a valid callback, function 'drush_update_do_one' not found or invalid function name batch.inc:163'.

drush_update_do_one exists in /home/elijah/.composer/vendor/drush/drush/commands/core/drupal/update.inc and isn't really in module_load_include()'s scope of responsibility.

What is the best way to boostrap Drush to have it run in an update function?

  • Shouldn't that be the other way around? i.e. you have a module which provides the functionality, which is installed on your site like any other and whose functionality can be used in an update hook, and the module also exposes the functionality as a drush command? I haven't come across an attempt to it the other way round before (doesn't mean it's not possible/normal of course) – Clive Jul 11 '16 at 12:16
  • I guess that would be logical. In this case though I think the conversion was only ever thought to happen in a drush command since it just happens one time. I guess an alternative is to just copy and adapt the commands into the update hook itself. – Elijah Lynn Jul 11 '16 at 12:42
  • I opened an issue here drupal.org/node/2764753 – Elijah Lynn Jul 12 '16 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.