Either workflow-ng or media_mover need to change their use of the configurations. I don't know which module needs to change. But if the mm_api_configurations() function isn't an exposed api, then I suspect that it's easier to change it here, so I'm entering the issue on MM. Thanks!

BTW, which version should I be using?

Comments

arthurf’s picture

There is a media_mover_api_get_configurations() which returns a list of all the media mover configurations. Is workflow-ng using '_configurations' as a hook?

douggreen’s picture

yes, module_invoke_all('configurations'), which conflicts with media_mover_api_configurations(). They do different things and take different arguments. I think that simply adding an underscore "_" to your module name would suffice, i.e., _media_mover_api_configurations().

arthurf’s picture

Doug-

The function is media_mover_api_get_configurations(), not media_mover_api_configurations(), so I'm a bit of at a loss for where this is happening. What version of workflow_ng are you using and what line(s) are you seeing the conflict on?

douggreen’s picture

My bad, it's module_invoke_all('configuration') not module_invoke_all('configurations'), see workflow_ng.module line 65, which calls ends up calling module_invoke_all('configuration').

Then see media_mover_api.module, line 1647:

/**
 * creates the landing page for an individual configuration
 *
 * @param int $cid is a configuration id
 * @return string html
 */
function media_mover_api_configuration($cid) {
  $config = media_mover_api_get_configuration($cid);
  drupal_set_title(t('Viewing: !name', array('!name' => $config->name)));
arthurf’s picture

Project: Media Mover » Workflow-ng
Component: Code » Miscellaneous

Wow. While I can change this function name, I really think that basing a hook name on "configuration" is really asking for trouble- the number of modules that might use functions called module_configuration() seems really large to me. I'd argue that this is really a workflow_ng issue, not a media mover issue, but I'll make the change to media mover anyway.

I'm switching the project issue over to workflow_ng to start some conversation there.

Fix is in CVS now.

arthurf’s picture

Title: Workflow-ng module_invoke_all('configurations') conflicts with media_mover_api_configurations() call » Workflow-ng module_invoke_all('configuration') conflicts with media_mover_api_configuration() call

Oh, and changing the title so the function names are right

douggreen’s picture

I agree, this hook should probably be called workflow_configuration.

douggreen’s picture

Version: 5.x-1.0-beta5 » 5.x-2.1
Component: Miscellaneous » Wng API

And fixing up the workflow-ng version and component...

fago’s picture

Status: Active » Closed (won't fix)

I agree with you, the hook name is dangerous and is a bad choice :( However it's part of the API, which is stable for quite a time, so I can't change it any more. I'm sry.

For 6,x (rules) that's already fixed.