I have some an action with this custom PHP code:

switch($duration) {
case 'One month':
    $expire = '+1 month';
    break;
case 'Two months':
    $expire = '+2 months';
    break;
case 'Three months':
    $expire = '+3 months';
    break;
default:
    break;
}

$node_added->expire_timefrom = $expire;
return array('node_added' => $node_added);

This code doesn't seem to have any effect though. Instead, the default expiration for this content type is used (+3 months). When would I call something like this for it to actually take effect? I also tried assigning a timestamp to $node_added->expire, but that resulted in the node having no expiration at all...I'd definitely appreciate any advice on this.

Note that I'm using 6.x-1.x node expire and not the 2.x which I found to be unworkable in its present state.

Comments

mitchell’s picture

Component: Rules Core » Rules Engine
Status: Active » Postponed (maintainer needs more info)

Which event are you using? 'After saving new content'?

klausi’s picture

Status: Postponed (maintainer needs more info) » Fixed

Reopen if still an issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.