Closed (works as designed)
Project:
Workflow
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2009 at 15:45 UTC
Updated:
16 Oct 2014 at 16:54 UTC
Jump to comment: Most recent
Comments
Comment #1
flebas commentedCreate an action "Change workflow state to new state" triggered on "after saving a new post".
Comment #2
jvandyk commented1. When editing your workflow, only allow the author to go to the state you desire. Then the workflow form will be suppressed, but the state will be assigned to the node.
2. There is no UI for that at present, but you can change weights in the workflow_states table.
Comment #3
robertdouglass commentedGood answers. Closing.
Comment #5
mnp commentedhi all
i have same problem
i have created 3 states
draft
publish
rejected
for administrator and editor
when creating node default state is rejected (selected)
i want to default state as draft
tried to change weights but it doesnt worked.
for other roles default is draft.
please help me
Comment #6
kenorb commentedMaybe hook_form_alter ?
Comment #7
thtas commentedhere is my solution to this using hook_form_alter
Comment #8
jeffschulerIn Workflow version 7.x-2.0 (7.x-2.0-beta9+17-dev) I set:
in hook_form_FORM_ID_alter().
Comment #9
johnvIn 7.x, you can set the weight in the Admin UI.
I've added a similar issue as a reference.
Comment #10
TBarina commentedI'm using workflow 7.x-2.2 and I see weights in Admin UI but they are not taken into account outside admin UI.
I mean, they are not taken into account:
- when seeing the list of possibile states that is shown when setting the workflow field in any entity;
- when a user with a particular role is adding any content the first state by SID and not by weight is the default value for the workflow field.
Does anybody knows how to fix that?
Many thanks in advance.
Comment #11
johnvDid you check "show weights" in the admin page? By default all options get the same weight. In the widget they have a different sort order. This is a flaw. Rearranging the options in admin ui explicitly, should fix the problem.
Comment #12
TBarina commentedTo Johnv (...sorry for my delay in answering): Yes I did! Here are my settings for states:
# | State | Weight | Active
1. Creation (grayed out) -20 yes
2. No promotion requested -19 yes
3. Promotion requested -18 yes
4. Promotion granted -17 yes
5. Promotion cancelled -16 yes
I noticed that all works well for root user since he can access any state.
But authenticated users only can access states n. 1 and 2 when creating new contents (according to permissions set in Transitions settings).
In this case the default value shown in the node creation form to authenticated users is "Promotion requested" (which was created first and moved to lower level by editing its weight).
Many thanks in advance.
(P.S.: I tried and enabled all states for authenticated users for node creation and the module behaves correcty in this case - i.e.: showing the first state, according to the assigned weights, as the default value)
Comment #13
johnv@TBarina, it was wrong of me to change the title, and with that the scope of the issue.
Please upgrade to lates version. (2.4 or 2.5-beta)
- The error with the with the weights has been solved.
- for states depending on author role, see the following issues:
#748814-14: Permitted transitions depending on extra roles of author.
#744272: Allow dynamic/flexible/freely definable transitions per state
In file workflow.api.php you'll find a new hook_workflow_permitted_state_transitions_alter(), in which you can filter the available transitions.
Pleasse reopen a new issue if you still have problems.