Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ctools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
ctools
Commits
508d5476
Commit
508d5476
authored
15 years ago
by
Earl Miles
Browse files
Options
Downloads
Patches
Plain Diff
Fix some problems with default task handlers and cloning task handlers.
parent
19695fab
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
delegator/delegator.admin.inc
+4
-1
4 additions, 1 deletion
delegator/delegator.admin.inc
delegator/delegator.module
+5
-0
5 additions, 0 deletions
delegator/delegator.module
includes/context.inc
+6
-3
6 additions, 3 deletions
includes/context.inc
with
15 additions
and
4 deletions
delegator/delegator.admin.inc
+
4
−
1
View file @
508d5476
...
@@ -780,7 +780,7 @@ function delegator_admin_list_form_submit($form, &$form_state) {
...
@@ -780,7 +780,7 @@ function delegator_admin_list_form_submit($form, &$form_state) {
// @todo -- do we need to clear the handler weight here?
// @todo -- do we need to clear the handler weight here?
}
}
// Otherwise, check to see if it has moved and, if so, update the weight.
// Otherwise, check to see if it has moved and, if so, update the weight.
elseif
(
$info
[
'weight'
]
!=
$form_state
[
'task_handlers'
][
$id
]
->
weight
)
{
elseif
(
$info
[
'weight'
]
!=
isset
(
$form_state
[
'task_handlers'
])
&&
$form_state
[
'task_handlers'
][
$id
]
->
weight
)
{
// Theoretically we could only do this for in code objects, but since our
// Theoretically we could only do this for in code objects, but since our
// load mechanism checks for all, this is less database work.
// load mechanism checks for all, this is less database work.
delegator_update_task_handler_weight
(
$form_state
[
'task_handlers'
][
$id
],
$info
[
'weight'
]);
delegator_update_task_handler_weight
(
$form_state
[
'task_handlers'
][
$id
],
$info
[
'weight'
]);
...
@@ -894,6 +894,9 @@ function delegator_admin_list_form_action_clone($form, &$form_state, $id, $actio
...
@@ -894,6 +894,9 @@ function delegator_admin_list_form_action_clone($form, &$form_state, $id, $actio
// Get the next weight from the form
// Get the next weight from the form
$handler
->
weight
=
delegator_admin_update_weights
(
$form_state
);
$handler
->
weight
=
delegator_admin_update_weights
(
$form_state
);
$handler
->
export_type
=
EXPORT_IN_DATABASE
;
$handler
->
type
=
t
(
'Normal'
);
// Generate a unique name. Unlike most named objects, we don't let people choose
// Generate a unique name. Unlike most named objects, we don't let people choose
// names for task handlers because they mostly don't make sense.
// names for task handlers because they mostly don't make sense.
$base
=
$form_state
[
'task'
][
'name'
];
$base
=
$form_state
[
'task'
][
'name'
];
...
...
This diff is collapsed.
Click to expand it.
delegator/delegator.module
+
5
−
0
View file @
508d5476
...
@@ -263,8 +263,13 @@ function delegator_load_task_handlers($task, $subtask_id = NULL, $default_handle
...
@@ -263,8 +263,13 @@ function delegator_load_task_handlers($task, $subtask_id = NULL, $default_handle
$defaults
=
isset
(
$default_handlers
)
?
$default_handlers
:
delegator_get_default_task_handlers
(
$task
,
$subtask_id
);
$defaults
=
isset
(
$default_handlers
)
?
$default_handlers
:
delegator_get_default_task_handlers
(
$task
,
$subtask_id
);
foreach
(
$defaults
as
$name
=>
$default
)
{
foreach
(
$defaults
as
$name
=>
$default
)
{
$result
=
delegator_compare_task_handlers
(
$handlers
,
$defaults
,
$name
);
$result
=
delegator_compare_task_handlers
(
$handlers
,
$defaults
,
$name
);
if
(
$result
)
{
if
(
$result
)
{
$handlers
[
$name
]
=
$result
;
$handlers
[
$name
]
=
$result
;
// Ensure task and subtask are correct, because it's easy to change task
// names when editing a default and fail to do it on the associated handlers.
$result
->
task
=
$task
[
'name'
];
$result
->
subtask
=
$subtask_id
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
includes/context.inc
+
6
−
3
View file @
508d5476
...
@@ -160,8 +160,8 @@ class ctools_context_required {
...
@@ -160,8 +160,8 @@ class ctools_context_required {
// Due to a bug, some contexts got recorded with an id of 0. This will
// Due to a bug, some contexts got recorded with an id of 0. This will
// convert them to the correct ID allowing for some earlier panels
// convert them to the correct ID allowing for some earlier panels
// to continue to work.
// to continue to work.
if
(
!
empty
(
$context
)
&&
$context
[
strlen
(
$context
)
-
1
]
==
0
)
{
if
(
!
empty
(
$context
)
&&
$context
[
strlen
(
$context
)
-
1
]
==
=
'0'
)
{
\
$context
[
strlen
(
$context
)
-
1
]
=
1
;
$context
[
strlen
(
$context
)
-
1
]
=
1
;
}
}
if
(
empty
(
$context
)
||
empty
(
$contexts
[
$context
]))
{
if
(
empty
(
$context
)
||
empty
(
$contexts
[
$context
]))
{
...
@@ -601,6 +601,10 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts) {
...
@@ -601,6 +601,10 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts) {
* are unique in the final list.
* are unique in the final list.
*/
*/
function
ctools_context_id
(
$context
,
$type
=
'context'
)
{
function
ctools_context_id
(
$context
,
$type
=
'context'
)
{
if
(
!
$context
[
'id'
])
{
$context
[
'id'
]
=
1
;
}
return
$type
.
'_'
.
$context
[
'name'
]
.
'_'
.
$context
[
'id'
];
return
$type
.
'_'
.
$context
[
'name'
]
.
'_'
.
$context
[
'id'
];
}
}
...
@@ -616,7 +620,6 @@ function ctools_context_id($context, $type = 'context') {
...
@@ -616,7 +620,6 @@ function ctools_context_id($context, $type = 'context') {
*/
*/
function
ctools_context_next_id
(
$objects
,
$name
)
{
function
ctools_context_next_id
(
$objects
,
$name
)
{
// Figure out which instance of this argument we're creating
// Figure out which instance of this argument we're creating
$id
=
0
;
if
(
!
$objects
)
{
if
(
!
$objects
)
{
return
$id
;
return
$id
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment