Question about different workflows per user

Events happening in the community are now at Drupal community events on www.drupal.org.
nadavoid's picture

I have two states in my workflow: Submitted and Published.

I want to restrict anonymous user to submitting to the Submitted state. (done.)

I want logged-in users to automatically post to the Published state. (almost there)

In the creation section of the workflow grid, I've set:
- Submitted: Author, anonymous user
- Published: authenticated user, Content Admin, Site Admin

There is no overlap between user roles in that workflow setup. However, when an authenticated user creates some new content, he is given the choice of Submitted or Published.

I don't even have to get rid of the "Submitted" option, if I can set the "Published" option to be selected by default for authenticated users.

any tips?

thanks in advance!

Comments

Set this via the transitions

bonobo's picture

And don't give authenticated users the right to move content into the "Submitted" state -- if authenticated users don't have the option of taking a node from creation to Submitted, they will not be presented with it.

This will be tricky, though, because you will actually need to remove the Author from the transition from "Creation" to "Submitted" -- I don't know what that will do :)

But your authenticated users are seeing the option to publish into the Submitted state because they are authors --

A fallback position could be weighting the "Submitted" state higher than published, and cleaning up the UI with some theming magic.

Cheers,

Bill

Cheers,

Bill


FunnyMonkey
Tools for Teachers

You're thinking the same as me

nadavoid's picture

One thing I tried already was removing the Author from posting to "Submitted" or "Published." When I do that, I get this error message: Please give the author permission to go from (creation) to at least one state!

so I have Author set to Submitted, because setting it to Published would mean that Anyone can post immediately to Published. We don't want that. ;)

Thanks for the suggestion about adjusting the weight of the two options. I just tried that, and they show up in the admin section in the new order (Published first) but when adding new content, Submitted is still listed first. Do you know how to make the weights affect the order inside the node submission form?

Where would I look to find out the name of the theme file to create that would modify the node submission form? An example is a "seminar" node type created using CCK.

this was written for 4.7. Do you think it would work in 5.x?

or this might work - any pointers on where I should look to do nothing more than select "Published" by default? or hide "Submitted" if "Published" is available.

I'm still sort of new to theming, and I'll probably just try the methods on the these two pages, unless anyone has any other suggestions.

Are these things that workflow-ng might be able to handle better?

IMO: 1. make the content

amitaibu's picture

IMO:
1. make the content type unpublished by default
2. install Workflow-ng
3. Create a configuration: If submitter is authenticated user, set the node 'Published'.

You can import this to your workflow-ng:

array (
  'cfg_15' =>
  array (
    '#type' => 'configuration',
    '#altered' => false,
    '#event' => 'node_insert',
    '#label' => 'Publish node is authenticaed user',
    '#active' => 1,
    '#module' => 'workflow-ng',
    0 =>
    array (
      '#type' => 'condition',
      '#name' => 'workflow_ng_condition_user_hasrole',
      '#label' => 'authenticated user?',
      '#settings' =>
      array (
        'roles' =>
        array (
          0 => 2,
        ),
        'operation' => 'OR',
      ),
    ),
    1 =>
    array (
      '#type' => 'action',
      '#name' => 'workflow_ng_action_node_publish',
      '#settings' =>
      array (
        'published' => 1,
      ),
      '#label' => 'Publish content',
    ),
    '#name' => 'cfg_15',
  ),
)

Workflow

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: