Closed (fixed)
Project:
Node expire
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
11 Aug 2009 at 20:55 UTC
Updated:
13 Jan 2014 at 18:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
david.lukac commentedHi,
I installed the patch but it causes following problem: when editing any content type, by default the "Disable node expire for this content type." is allways checked, even after saving this content type after unchecking the box. Of course node_expire settings never appear when creating/editing content.
Thanks,
David
Comment #2
rvallejo commentedI think the problem with the disabled setting always being checked is because its not saving the value into the node_expire_ntypes array. You need to add the following to the end of the "if" statement in node_expire.ntype.inc file: $ntypes[$form_state['values']['type']]['disable'] = $form_state['values']['node_expire_disable'];
I think that should do it. I'm trying to modify this a little bit to make it an enable function rather than disable, and automatically unsetting the required value if disabled. Not much of a programmer myself, but I'll post it up if it'll be helpful for others.
Comment #3
rvallejo commentedAlright, here's my stab at a patch. This compiles a few fixes - disabling/enabling for certain node types as well as cron issues (patch at http://drupal.org/node/426636#comment-1651286) and the empty default issue (patch at http://drupal.org/node/405608, with changes in comment #11). Also fixed a couple of small grammatical errors, and added a line to the description on node creation to let users know if/what the limit on the expiration date is.
Its functional for what I'm doing, but it is my first patch and I'm not really much of a programmer or anything so there may very well be better ways to get the same results.
And just as a note, I made it so when Expiration is disabled, the Default and Max fields don't show on content type configuration pages. I thought it might be good to use javascript to show these when enabling Expiration, but for now you'd have to click Enabled or Required, save, and go back to edit the content type to get the forms. To keep the forms at all times, just add the lines below after where the patch says to delete from node_expire.module (line 71), and ignore the rest of the changes for that file (*don't delete where it says to delete).
+ $form['workflow']['node_expire_settings'] = array(
+ '#type' => 'radios',
+ '#title' => t('Node Expire'),
+ '#default_value' => variable_get('node_expire_settings_'. $form['#node_type']->type, 0),
+ '#options' => array(t('Disabled'), t('Enabled'), t('Required')),
+ );
Comment #4
rvallejo commentedAdditional note on the last piece of my comment: to show default and max expiration date fields all the time, add the new form array (node_expire_settings) to the beginning of the section, and delete the last form array (node_expire_required). So, it would look like this:
+ $form['workflow']['node_expire_settings'] = array(
+ '#type' => 'radios',
+ '#title' => t('Node Expire'),
+ '#default_value' => variable_get('node_expire_settings_'. $form['#node_type']->type, 0),
+ '#options' => array(t('Disabled'), t('Enabled'), t('Required')),
+ );
$form['workflow']['node_expire'] = array(
'#title' => t('Expiration Date'),
'#description' => t('Default date to consider the node expired.') .' '. t('Format: PHP strtotime format.') .' '. t('Leave it blank if this content type never expires.'),
'#type' => 'textfield',
'#default_value' => empty($ntypes[$ntype]['default']) ? '' : $ntypes[$ntype]['default'],
);
$form['workflow']['node_expire_max'] = array(
'#title' => t('Expiration Date Limit'),
'#description' => t('The max date to consider the node expired.') .' '. t('Format: PHP strtotime format.') .' '. t('Leave it blank if this there is no limit date.'),
'#type' => 'textfield',
'#default_value' => empty($ntypes[$ntype]['max']) ? '' : $ntypes[$ntype]['max'],
);
- $form['workflow']['node_expire_required'] = array(
- '#title' => t('Expiration Date Required'),
- '#type' => 'checkbox',
- '#default_value' => !empty($ntypes[$ntype]['required']),
- );
Comment #5
bomarmonk commentedI tried this patch against a clean copy of 6.x node_expire, but I get a patch malformed message. Maybe I'm doing the patch command wrong? Could you post a complete zip of your working module as the official dev verion is fairly useless right now.
Comment #6
aaronbaumanI switched to scheduler module, fwiw
Does everything I used node_expire for, and then some.
Comment #7
rvallejo commentedIts likely I didn't make the patch right, but here's a zip of the patched module I'm working with.
Comment #8
marshallexcavating commentedThank you rvallejo (#7) for attaching the zipped patch; it works great for me.
Comment #9
marshallexcavating commentedI spoke to soon. I have the node_expire disabled on one of my content node types but after each cron they get unpublished. when i republish them the attached file shows the error.
Any help would be appreciated.
Comment #10
klonosany news on this one?
Comment #11
marshallexcavating commentedI have given up on node_expire and am using auto_expire.
Comment #12
vikramy commentedTake a look at #21 patch.
http://drupal.org/node/405608. This might help. Will revisit this.
Comment #13
vikramy commentedCheck out 6.x-2.x-dev. Report bugs if any.
Comment #14
klonosI am using the latest 6.x-2x dev, but I don't see this fixed. Is there supposed to be a per-node or per-content-type setting somewhere?
Comment #15
vikramy commentedSorry.. This is not yet fixed.. Caught up with some work. Also my priority is to first fix this http://drupal.org/node/435560.
If you can explain your use-case, that would be helpful.
Also can you take a look at http://drupal.org/node/644682. Suggest me if you have any idea.. Thanks.
Comment #16
Jb33 commentedhi, I'd also love to have this feature. Node comments expiration make no sense on my site.. :-) Do the latest dev or stable releases contain this feature..?
Comment #17
Jb33 commentedIs this feature working in the stable release?
Comment #18
1kenthomas commented//subscribing.
Somewhat OT: is there any reason to maintain this module given the presence of scheduler? Is there anything Node Expire does, that can't be accomplished by Scheduler?
UPDATE: well, Scheduler triggers publish/uppublish; it cannot insert its own Event into Rules (so far). Might make sense to merge, or fork a merger into a general-purpose module to allow "scheduled triggering of a Rule".
Comment #19
Nafes commentedThe patches have been committed to the branch 'feature-6/disable-for-certain-node-types'. The issue has been fixed in the release 7.x-1.0-alpha3. Thanks!
Comment #20
Nafes commented