Skip to content
Snippets Groups Projects
Commit 9fbd59d7 authored by Earl Miles's avatar Earl Miles
Browse files

Fix invalid context ID creation.

parent a9c6812e
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,11 @@ function delegator_page_delegator_tasks() {
// 'page callback' => 'delegator_page_execute',
// context only items
'handler type' => 'context',
'get arguments' => 'delegator_page_get_arguments',
'get arguments' => array(
'file' => 'page.admin.inc',
'path' => drupal_get_path('module', 'delegator') . '/plugins/tasks',
'function' => 'delegator_page_get_arguments',
),
'get context placeholders' => 'delegator_page_get_contexts',
'access restrictions' => 'delegator_page_access_restrictions',
'uses handlers' => TRUE,
......@@ -333,13 +337,12 @@ function delegator_page_execute($subtask_id) {
* Return a list of arguments used by this task.
*/
function delegator_page_get_arguments($task, $subtask_id) {
$page = delegator_page_load($subtask_id);
$page = delegator_page_get_page_cache($subtask_id);
return _delegator_page_get_arguments($page);
}
function _delegator_page_get_arguments($page) {
$arguments = array();
if (!empty($page->arguments)) {
foreach ($page->arguments as $keyword => $argument) {
if (isset($argument['name'])) {
......
......@@ -619,9 +619,10 @@ function ctools_context_id($context, $type = 'context') {
* The name being used.
*/
function ctools_context_next_id($objects, $name) {
$id = 0;
// Figure out which instance of this argument we're creating
if (!$objects) {
return $id;
return $id + 1;
}
foreach ($objects as $object) {
......@@ -631,7 +632,8 @@ function ctools_context_next_id($objects, $name) {
}
}
}
return $id;
return $id + 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment