I have created two configuration, both involve promoting nodes to the front page when either they are commented on or updated. It seemed rather simple, all I needed to do was add a condition (content has type 'entry) and an action (promote/demote content to/from front page - checked promote to front page) but when I attempted testing them out, nothing happened. Well something did happen on the updated node one, I got the error message:
* Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/15889/domains/openecosource.org/html/modules/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /home/15889/domains/openecosource.org/html/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /home/15889/domains/openecosource.org/html/modules/workflow_ng/workflow_ng/workflow_ng.module on line 507.
Am I doing something wrong? I am somewhat of a Drupal newbie and really like this module and would be so grateful if you could help me getting it to work.
Thanks!
Comments
Comment #1
MikeMoirano commentedIs it possible I need to change something within my custom view for the front page?
Comment #2
fagohm, could you please export your configuration? Have you updated from 1.3 or is it a fresh install?
If you have updated, be sure to run update.php afterwards.
Comment #3
MikeMoirano commentedIt was a fresh install.
1. For promoting a node when commented on:
array (
'cfg_1' =>
array (
'#type' => 'configuration',
'#altered' => false,
'#event' => 'comment_insert',
'#label' => 'Promote node when commented on',
'#active' => 0,
'#module' => 'workflow-ng',
0 =>
array (
'#type' => 'condition',
'#name' => 'workflow_ng_condition_content_is_type',
'#argument map' =>
array (
'node' => 'node',
),
'#settings' =>
array (
'type' =>
array (
'submission' => 'submission',
),
),
),
1 =>
array (
'#type' => 'action',
'#name' => 'workflow_ng_action_node_promote',
'#argument map' =>
array (
'node' => 'node',
),
'#settings' =>
array (
'promote' => 1,
),
),
'#name' => 'cfg_1',
),
)
2. For promoting a node when updated:
array (
'cfg_3' =>
array (
'#type' => 'configuration',
'#altered' => false,
'#event' => 'node_update',
'#label' => 'Promote node to front page when updated',
'#active' => 0,
'#module' => 'workflow-ng',
0 =>
array (
'#type' => 'condition',
'#name' => 'workflow_ng_condition_content_is_type',
'#argument map' =>
array (
'node' => 'node',
),
'#settings' =>
array (
'type' =>
array (
'submission' => 'submission',
),
),
),
1 =>
array (
'#type' => 'action',
'#name' => 'workflow_ng_action_node_promote',
'#argument map' =>
array (
'node' => 'node',
),
'#settings' =>
array (
'promote' => 1,
),
),
'#name' => 'cfg_3',
),
)
Thanks for your help, I really appreciate it
Comment #4
MikeMoirano commentedif you need access to my site let me know, I really don't know what the problem could be.
I have also enabled emailing users when a post is commented on and it seems to be working.
Thanks
Comment #5
mlsamuelson commentedI'm having the same errors.
Here's my configuration. It sets a node to unpublished and sends an arbitrary email when it's a blog post coming from someone without a moderator role:
And here's a copy of the errors:
* Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/public_html/sites/all/modules/contributed/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /home/public_html/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /home/public_html/sites/all/modules/contributed/workflow_ng/workflow_ng/workflow_ng.module on line 507.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/public_html/sites/all/modules/contributed/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /home/public_html/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /home/public_html/sites/all/modules/contributed/workflow_ng/workflow_ng/workflow_ng.module on line 507.
The configuration works, though.
Comment #6
mlsamuelson commentedI just setup another configuration on the same site, this configuration is to send an email when a comment is submitted. The conditions and actions are nearly identical, except in this case there was no need to use "content has type" in my conditions, and no need for "publish/unpublish content" in the actions.
This configuration threw no errors.
So perhaps this helps narrow things down.
Comment #7
fagodo you have the "states" module enabled? Or had you?
Comment #8
fagook, I think I found the bug. It was a caching issue. Now workflow-ng cleares it's cache when you visit admin/build/modules. So please update to the latest dev version, visit the modules page and the warnings should go away.
Comment #9
MikeMoirano commentedI really appreciate your help on this, but I updated the module, ran update php, and am still getting error messages:
* Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/15889/domains/openecosource.org/html/modules/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /home/15889/domains/openecosource.org/html/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /home/15889/domains/openecosource.org/html/modules/workflow_ng/workflow_ng/workflow_ng.module on line 507.
Also, the actions are not occuring.
Thanks for your help.
Comment #10
daniellepalladino commentedI'm also getting these errors :
* Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.serpico/slambert/add-art.org/sites/all/modules/workflow_ng/workflow_ng/workflow_ng.module on line 503.
* warning: Invalid argument supplied for foreach() in /home/.serpico/slambert/add-art.org/includes/common.inc on line 1314.
* warning: Invalid argument supplied for foreach() in /home/.serpico/slambert/add-art.org/sites/all/modules/workflow_ng/workflow_ng/workflow_ng.module on line 507.
After the user submits one content type, the configuration redirects them to the submit page for a different content type. It works, but the error messages are appearing. I installed the latest dev version and they're still there.
Thanks for the help!
Here's my configuration:
Comment #11
xerbutter commentedHi,
I just thought I'd let you know I'm also getting these errors, even when I disable all Workflow-ng configurations.
I tried clearing the workflow-ng cache but that did not seem to help.
Let me know if there's any other info I can provide or things you'd like me to try. Thanks for your help!
Comment #12
rastarr commentedHi,
Also getting it here. I thought it was an UberCart issue though even creating a new user on a new Drupal install, I get the following error:
Comment #13
Anonymous (not verified) commentedI'm also still getting the same error. I do not get the machine state error, but I have the module enabled.
My configuration for the workflow:
array (
'cfg_3' =>
array (
'#type' => 'configuration',
'#altered' => false,
'#event' => 'node_insert',
'#label' => 'Force outlining of lessons',
'#active' => 1,
'#module' => 'workflow-ng',
0 =>
array (
'#type' => 'condition',
'#name' => 'workflow_ng_condition_content_is_type',
'#argument map' =>
array (
'node' => 'node',
),
'#settings' =>
array (
'type' =>
array (
'lesson' => 'lesson',
),
),
),
1 =>
array (
'#type' => 'action',
'#name' => 'workflow_ng_action_drupal_goto',
'#settings' =>
array (
'path' => 'node/[node:nid]/outline',
'path_args' =>
array (
0 => 'node',
),
'query' => '',
'query_args' =>
array (
),
'fragment' => '',
'fragment_args' =>
array (
),
'force' => 1,
'override' => 1,
),
'#label' => 'Page redirect',
),
2 =>
array (
'#type' => 'action',
'#name' => 'workflow_ng_action_drupal_message',
'#settings' =>
array (
'message' => 'Before this lesson is viewable to your students, you will need to position it within a existing parent unit, or designate it as a parent unit.',
'message_args' =>
array (
),
'error' => 0,
),
'#label' => 'Show a configurable message on the site',
'#weight' => '1',
),
'#name' => 'cfg_3',
),
)
Comment #14
fagohm, strange. I was able to reproduce it and for me it was fixed.
Please report whether you have the states module enabled?
Comment #15
rastarr commentedYes, I have the States Machine, Configuration Content Links and Workflow_NG GUI enabled
Comment #16
fago? That's really strange.
The above error "* Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated." says, that there is a configuration that makes use of this action, but the action is not available.
So the states module provides both, the action as well as configuration that makes use of it (it's fixed, so it doesn't appear in the UI). However, if you have the module activated, the action must be available!
Previously, there was a caching issue. So the configuration of the states module was still active although the module might have been already deactivated. This is fixed now in the latest -dev release, as the cache gets cleared when you visit the modules page.
So, I can't really imagine what is causing this, but try that:
* remove the whole workflow-ng folder + any states module installation you might have elsewhere.
* download the latest -dev snap shot and use this one instead
Does this change anything?
If not, try disabling and re-enabling the states module.
Comment #17
xerbutter commentedOkay, made some progress:
When I had the full set of modules enabled (Configurable Content Links, State Machine API, Workflow-ng, Workflow-ng UI), I get the full set of errors.
After disabling Configurable Content Links and State Machine API, I get just one error: "Unable to find action of name states_generate_events. Perhaps the according modules has been deactivated."
After clearing cache_workflow_ng from the DB, I don't get any errors anymore.
Re-enabling Configurable Content Links and State Machine API, I don't get the errors anymore.
Hope that helps.
Comment #18
rastarr commentedSorry - what do you mean clearing ache_workflow_ng from the DB ??
Do you mean you deleted that table altogether?
Or you deleted the contents of the tables in there - if this is so, how do you do that. Sorry for being a dope but not sure what needs to be done to 'clear' it
Comment #19
Anonymous (not verified) commentedAfter reading your comment, I disabled Content Links and State Machine, and no longer receive the error message. However clearing the cache_workflow_ng table and reenabling the two modules did not work, as I still got the message. So for now I will just keep those two modules disabled, since I'm not using them anyway.
Comment #20
xerbutter commentedrastarr,
I deleted the contents of the cache_workflow_ng table from my drupal database. I did NOT delete the table altogether. I used a tool called phpMyAdmin which lets you edit and manage a MySQL database. I'd recommend using it to start learning how MySQL works. You can also use the MySQL monitor (a command line tool) to manage your database. In any case, be careful when editing your database, you should always make backups and if you don't have experience with it you should probably get some practice on data you don't care about first.
Hope that helps.
Comment #21
fagoto summarize
1. be sure to have a clean workflow-ng install. Best remove the old installation, then replace it with the latest development snapshot, don't use 1.4!
2. Disable the states module! If you have already, anyhow visit the modules and save it. This makes sure, that workflow-ng's cache is cleared! There is no need to manually clear the cache. Then the errors must be gone!
3. Reenable the states module - now this should work too.
Comment #22
decipheredI attempted this supposed fix:
- Disabled the two offending modules
- Went to clear the cache but found it was already cleared (I do a lot of manual cleanup of my DB while testing)
- Confirmed that the errors no longer existed
- Then re-enabled the modules only to find that that errors had returned.
I'd be happy to supply any data necessary as I really need this issue fixed.
Comment #23
rastarr commentedI disabled and uninstalled the entire workflow_ng modules including the content links and states.
Deleted the module's files, downloaded the latest dev release and uploaded.
Re-enabled the modules and the errors are still occurring unfortunately.
Let me know what data you need to get this working - happy to supply
Comment #24
mlsamuelson commentedI uninstalled the states module, updated my copy of workflow_ng to the most recent CVS version, reinstalled states, and at this point I haven't experienced the error again.
So at this point it appears to be resolved. Thanks fago!
mlsamuelson
Comment #25
fagoso, for some people it's solved for others not - that's strange.
* So again, are you sure that you use the latest dev version? Best download it again.
* If it persists, is the error dependent on any configuration? Or does it go away if you remove all configurations?
* Does it appear on a fresh drupal with no modules except workflow-ng and co?
Comment #26
phillip.bennington commentedI tried using some of the suggestions mentioned in this thread, however I am having the issue still.
It seems to only rear it's head while making changes to my users - though I haven't tried many other places.
This is a fresh install, current dev.
Ubercart module is installed, however disabling UC modules does not prevent error from coming up.
disabling workflow modules does, however, prevent this message.
Comment #27
fagohm. The problem is, I can't reproduce it any more since my fix.
Furthermore it's not really clear to me, when the errors are occurring.
So everyone facing this problem, please help by:
First of, make sure that you use the latest dev version. Best download it again. Completely delete the old install and replace it with the latest one. Go to the admin modules page and save it. Then please answer these questions:
* Are you using Drupal 5.5?
* Are you using php4 / php5?
* Are the errors occurring, when the states module is inactive or active, or both?
* When does the errors occur? Do they occur when a) editing users, b) editing nodes, c) else?
* Does the error occur, on a fresh drupal install with no modules except workflow-ng and co enabled, too?
* Does it help if you delete all configurations?
Comment #28
fagoha, I've found it! The error occurred only, when the states module was active, but no state machine defined. E.g. if you have defined a cclink, the errors were gone.
I've just fixed it, so download the latest dev version.
Comment #29
rastarr commentedI just downloaded and installed the latest dev release - it was dated 25th Dec however the error has gone for me so that's terrific.
Thanks for tracking it down and getting it fixed, fago.
Comment #30
phillip.bennington commenteddownloaded and installed latest dev of workflow-ng, problem is gone.
Thanks for the fix.
Comment #31
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.