Comments

deekayen’s picture

Just now starting our D7 upgrade analysis. We'll be bringing this module into 7, but I have no timeline other than 3 months or less.

jeffschuler’s picture

Thanks!

codeelegance’s picture

Initial commit of 7.x has been committed.

playfulwolf’s picture

this one? http://drupal.org/node/433364
it is dated february 25th with one active user...

jeffschuler’s picture

codeelegance: thanks! Will check it out.

PlayfulWolf: it's still only in version control; not packaged as a release. You can clone the 7.x-1.x branch of the project via git from the Version control tab on the project page.

jeffschuler’s picture

I was getting errors in a few different places. Here's a patch that fixes them.

Sometimes $form[$starting_state] is an object:

@@ -120,7 +120,7 @@ function theme_workflow_named_transitions_edit_labels_form($variables) {
   // doing something with element_children() might be a better way
   // than this foreach looping methods
   foreach ($form as $starting_state => $transitions) {
-    if (isset($form[$starting_state]['#type']) && $form[$starting_state]['#type'] == 'fieldset') {
+    if (is_array(isset($form[$starting_state])) && isset($form[$starting_state]['#type']) && $form[$starting_state]['#type'] == 'fieldset') {
       $rows = array();
       foreach ($transitions as $tid => $item) {
         if (is_numeric($tid)) {

db_delete's execute() is missing parentheses:

@@ -163,7 +163,7 @@ function workflow_named_transitions_edit_labels_form_submit($form, &$form_state)
     else {
       db_delete('workflow_named_transitions')
         ->condition('tid', $tid)
-        ->execute;
+        ->execute();
     }
   }
 }

targets should be a string instead of an array:

@@ -230,7 +230,7 @@ function workflow_named_transitions_form_alter(&$form, &$form_state, $form_id) {
           SELECT sub_wt.tid FROM {workflow_transitions} AS sub_wt WHERE sub_wt.sid = :sid AND sub_wt.target_sid IN(:targets))",
           array(
             ':sid' => $workflow->starting_sid,
-            ':targets' => array(array_keys($form['workflow'][$workflow->name]['#options']))
+            ':targets' => implode(',', array_keys($form['workflow'][$workflow->name]['#options'])),
           )
         );
         foreach ($tids_result as $options_to_update) {

thanks!

jeffschuler’s picture

Status: Active » Needs review
StatusFileSize
new2.08 KB

Oops. we don't need the implode(), we just need one less array() wrapping.

-            ':targets' => array(array_keys($form['workflow'][$workflow->name]['#options']))
+            ':targets' => array_keys($form['workflow'][$workflow->name]['#options']),
codeelegance’s picture

jeffschuler: Thanks for that catch. I'm still a beginner here....
I've applied the patch and pushed the branch back up.

jeffschuler’s picture

codeelegance: awesome. Thanks for committing so quickly.

Please check out the articles on Commit messages and Adding a commit author, as commit authorship credit is always appreciated. :)

Think we get a 7.x dev release out?

codeelegance’s picture

Oops. As stated, I'm a total newbie when it comes to this stuff. I wish etiquette was as simple as code....

guypaddock’s picture

One issue I've noticed so far is that hook_install() causes a database error because it tries to install the schema a second time, which is no longer necessary in Drupal 7.

The attached patch corrects this.

guypaddock’s picture

Actually, the entire install logic is broken... hmm.

This should probably use hook_module_implements_alter() instead of manipulating weight directly.

Josh Benner’s picture

I think setting weight in hook_install() is still allowed/recommended per http://drupal.org/node/110238?

Josh Benner’s picture

... though I suppose it could be a problem if Workflow's weight changes. Yeah, hook_module_implements_alter() is probably a good idea.

deekayen’s picture

Status: Needs review » Active

This is marked needs review, but it doesn't look like there's anything to review. Changing status.

jeffschuler’s picture

Can we add 7.x-1.x as a dev release on the project page and close this, then?

Mark F’s picture

Hi. I could really do with a D7 version of this right now ;-)
Anything I can do to help?

g089h515r806’s picture

StatusFileSize
new11.36 KB

A workable version. work with workflow extention, transition type "single button".
I have fixed a lot of update issues.

deekayen’s picture

Status: Active » Needs work

There's a bunch of commented code, functions, and debug stuff left in there. I'm guessing you're not done with it.

jeffschuler’s picture

Rehashing what I said in #16:
There is a 7.x version in git.
Adding a 7.x dev release might help this get fixed faster, by allowing for specific issues with smaller fixes...
Can we do that?

johnv’s picture