Hi,
I am not sure whether this is a ctools bug or a features module bug, but i am going to post here first of all since the error message itself is being generated from ctools.

I am using features in conjunction with ctools to export panel pages (+ other stuff) to code. I am not using the built in ability of features to export a panel, since i dont believe it is functionally complete and working yet (issues here - http://drupal.org/node/532256).
I am using features version 6.x-1.0-beta-4.

I am instead using the default method of running a panel page from code.
In my module file i have the following -

/**
 * Implementation of hook_ctools_plugin_api().
 */
function mymodule_ctools_plugin_api($module, $api) {
  if ($module == 'page_manager' && $api == 'pages_default') {
    $module_path = drupal_get_path('module', 'defaqto_guides');
    return array('version' => 1, 'path' => $module_path);
  }
}

And in my modules folder i have a corresponding mymodule.pages_default.inc file with the following -

function mymoulde_default_page_manager_handlers() {
$handlers = array();

//handler export code here...

$handlers[$handler->name] = $handler;

return $handlers;
}

When i disable and then re-enable one of my features i get the following error -

warning: Missing argument 1 for mymodule_ctools_plugin_api() in mymodule.module on line 16.

The panels actually still all work okay, but this bug keeps on coming up every time i re-enable each feature.

Comments

merlinofchaos’s picture

Hmm. Does the error message tell you what line the call is coming from? That's where the error is, not where the function was defined. It'll be hard to figure this out without that information.

In the worst case, you can probably figure out where this is being called from using dsm() and debug_backtrace() (assuming you're using devel.module)

tayzlor’s picture

hi merlin,

pasting debug_backtrace() code below if it is of any help to you (starting from calling the feature enable function)

 [0] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\includes\plugins.inc
            [line] => 64
            [function] => defaqto_ctools_plugin_api
            [args] => Array
                (
                    [0] => page_manager
                    [1] => pages_default
                )

        )

    [1] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\includes\plugins.inc
            [line] => 109
            [function] => ctools_plugin_api_info
            [args] => Array
                (
                    [0] => page_manager
                    [1] => pages_default
                    [2] => 1
                    [3] => 1
                )

        )

    [2] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\includes\export.inc
            [line] => 297
            [function] => ctools_plugin_api_include
            [args] => Array
                (
                    [0] => page_manager
                    [1] => pages_default
                    [2] => 1
                    [3] => 1
                )

        )

    [3] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\includes\export.inc
            [line] => 161
            [function] => _ctools_export_get_defaults
            [args] => Array
                (
                    [0] => page_manager_handlers
                    [1] => Array
                        (
                            [identifier] => handler
                            [bulk export] => 1
                            [export callback] => page_manager_export_task_handler
                            [api] => Array
                                (
                                    [owner] => page_manager
                                    [api] => pages_default
                                    [minimum_version] => 1
                                    [current_version] => 1
                                )

                            [key] => name
                            [object] => stdClass
                            [status] => default_page_manager_handlers
                            [default hook] => default_page_manager_handlers
                            [can disable] => 1
                            [list callback] => page_manager_page_manager_handlers_list
                            [to hook code callback] => page_manager_page_manager_handlers_to_hook_code
                        )

                )

        )

    [4] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\page_manager\page_manager.module
            [line] => 423
            [function] => ctools_export_load_object
            [args] => Array
                (
                    [0] => page_manager_handlers
                    [1] => conditions
                    [2] => Array
                        (
                            [task] => node_view
                        )

                )

        )

    [5] => Array
        (
            [file] => C:\www\sites\all\modules\contrib\ctools\page_manager\page_manager.module
            [line] => 526
            [function] => page_manager_load_task_handlers
            [args] => Array
                (
                    [0] => Array
                        (
                            [task type] => page
                            [title] => Node template
                            [admin title] => Node template
                            [admin description] =&gt; When enabled, this overrides the default Drupal behavior for displaying nodes at <em>node/%node</em>. If you add variants, you may use selection criteria such as node type or language or user access to provide different views of nodes. If no variant is selected, the default Drupal node view will be used. This page only affects nodes viewed as pages, it will not affect nodes viewed in lists or at other locations. Also please note that if you are using pathauto, aliases may make a node to be somewhere else, but as far as Drupal is concerned, they are still at node/%node.
                            [admin path] =&gt; node/%node
                            [hook menu] =&gt; page_manager_node_view_menu
                            [hook menu alter] =&gt; page_manager_node_view_menu_alter
                            [handler type] =&gt; context
                            [get arguments] =&gt; page_manager_node_view_get_arguments
                            [get context placeholders] =&gt; page_manager_node_view_get_contexts
                            [disabled] =&gt; 
                            [enable callback] =&gt; page_manager_node_view_enable
                            [module] =&gt; page_manager
                            [name] =&gt; node_view
                            [path] =&gt; sites/all/modules/contrib/ctools/page_manager/plugins/tasks
                            [file] =&gt; node_view.inc
                            [plugin module] =&gt; page_manager
                            [plugin type] =&gt; tasks
                        )

                    [1] =&gt; 
                )

        )

    [6] =&gt; Array
        (
            [file] =&gt; C:\www\sites\all\modules\contrib\ctools\page_manager\page_manager.module
            [line] =&gt; 224
            [function] =&gt; page_manager_load_sorted_handlers
            [args] =&gt; Array
                (
                    [0] =&gt; Array
                        (
                            [task type] =&gt; page
                            [title] =&gt; Node template
                            [admin title] =&gt; Node template
                            [admin description] =&gt; When enabled, this overrides the default Drupal behavior for displaying nodes at <em>node/%node</em>. If you add variants, you may use selection criteria such as node type or language or user access to provide different views of nodes. If no variant is selected, the default Drupal node view will be used. This page only affects nodes viewed as pages, it will not affect nodes viewed in lists or at other locations. Also please note that if you are using pathauto, aliases may make a node to be somewhere else, but as far as Drupal is concerned, they are still at node/%node.
                            [admin path] =&gt; node/%node
                            [hook menu] =&gt; page_manager_node_view_menu
                            [hook menu alter] =&gt; page_manager_node_view_menu_alter
                            [handler type] =&gt; context
                            [get arguments] =&gt; page_manager_node_view_get_arguments
                            [get context placeholders] =&gt; page_manager_node_view_get_contexts
                            [disabled] =&gt; 
                            [enable callback] =&gt; page_manager_node_view_enable
                            [module] =&gt; page_manager
                            [name] =&gt; node_view
                            [path] =&gt; sites/all/modules/contrib/ctools/page_manager/plugins/tasks
                            [file] =&gt; node_view.inc
                            [plugin module] =&gt; page_manager
                            [plugin type] =&gt; tasks
                        )

                    [1] =&gt; 
                )

        )

    [7] =&gt; Array
        (
            [file] =&gt; C:\www\sites\all\modules\contrib\ctools\page_manager\page_manager.module
            [line] =&gt; 328
            [function] =&gt; page_manager_get_page_cache
            [args] =&gt; Array
                (
                    [0] =&gt; node_view
                )

        )

    [8] =&gt; Array
        (
            [file] =&gt; C:\www\sites\all\modules\features\defaqto\defaqto.install
            [line] =&gt; 72
            [function] =&gt; page_manager_cache_load
            [args] =&gt; Array
                (
                    [0] =&gt; node_view
                )

        )

    [9] =&gt; Array
        (
            [function] =&gt; defaqto_enable
            [args] =&gt; Array
                (
                )

        )


merlinofchaos’s picture

            [file] =&gt; C:\www\sites\all\modules\contrib\ctools\includes\plugins.inc
            [line] =&gt; 64
            [function] =&gt; defaqto_ctools_plugin_api
            [args] =&gt; Array
                (
                    [0] =&gt; page_manager
                    [1] =&gt; pages_default
                )

        )

That clearly has arguments in the call, so it can't be the problem. You might want to wrap your debug in a check to test if the first argument is NULL.

tayzlor’s picture

Hello,
wrapping the debug in an if statement to check if $module is set, the debug_backtrace() never gets called but the error still comes up on the screen. weirdness.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Well, I'm at a bit of a loss to explain this. :/

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Unable to replicate. I hate stuff like this - maybe someone in features has an idea?