Closed (fixed)
Project:
Workflow
Version:
8.x-1.x-dev
Component:
Rules
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2008 at 20:22 UTC
Updated:
17 Mar 2025 at 13:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
shariharan commentedsubscribing
Comment #2
mglover commentedI ended up doing this (on 6.x) with a custom action. I assigned it to my workflow for all state changes to my Published state and it updates the creation date to match the scheduled timestamp. At first I was was just changing creation date to now(), but that ends up setting most posts to match my cron timing.
Here's my code. This is my first custom action, so please feel free to improve on it.
Comment #3
jhedstromI've added slightly modified code from #2 as an attached patch to 6.x.
Comment #4
stattler commentedThis patch has no effect on node creation date, i.e., it does not change the creation date to the "published" date. Does it mean that the file was not patched correctly? I followed the correct way of patching and it confirmed that the patch was done.
Went to drupal root/sites/all/modules/workflow
and then did:
patch < patch.file.name
Comment #5
fivehimself commentedThis is exactly what I'm looking for! I've added this code to my template.php, but couldn't find the action in my actions or trigger page...
Could you tell me where to put this code?
Comment #6
vood002 commentedThanks for the code, works great for me.
I changed it a little bit since I don't publish all my content from workflow date:
fivehimself: i dont think this will work out of template.php, i added it to a custom module that I just throw all my random functions into.
Comment #7
finex commentedThe modified patch by vood002 looks fine... and why not add an explicit checkbox to use that date (like the scheduler module) ?
Comment #8
hillaryneaf commentedUsing vood002's code, I get:
Fatal error: Call to undefined function now()
Comment #9
hillaryneaf commentedI couldn't get vood002's code to work, the if statements always returned false.
In the custom module I made, I just checked if the node has a workflow state assigned to it like this:
Hope this helps someone!
Comment #10
jrstmartin commented@nektir and @mglover
Thank you! Works great with Workflow 1.5 and Rules.
Comment #11
johnvre-classifying as a Rules/Actions & Triggers issue.
Comment #12
johnvMoving all remaining D6 issues to D7.
In general, Workflow only changes its own state. Changing other fields/properties should be done using hooks/Rules/Actions.
We might add default actions, but ATM, reclassifying this as a Support Request as a help for other users.
Comment #13
johnvRenaming title. The patch is outdated. A new attempt is welcome.
Comment #14
johnvComment #15
arun.mytimez commentedI am not an expert, but for a similar scenario I had used the Publication Date (publication_date) module along with the Rules module.
The Publication Date module adds a datetime field to the publish section of the form which can be set manually or use the Rules module to define rule to set the publication field to the date when the required state is set. I had created a rule to set this date to the systems current datetime value and set the drupal default publish checkbox to true when the workflow field has got the publish state when the form is saved.
The export of the rules definition is as below.
Maybe you can work on similar lines to get your requirements met.
Comment #16
johnvIn D8 the contrib module Workflow State Configuration is a good candidate to include this feature.
See #294000: Set node's 'published' date to Workflow state change date.
Comment #17
socialnicheguru commentedalso there is the scheduler module
Comment #18
johnvI am not sure where/when it was introduced, but ITMT we have implemented a Workflow Option "Always update the entity last updated timestamp".