Needs review
Project:
modr8
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2009 at 12:12 UTC
Updated:
22 Apr 2012 at 01:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI've got to agree here. One problem I'm running into is that without the ability to have mdr8 publish content (as opposed to marking moderated), unmoderated content can appear in various places such as my sitemap. The current fix is to turn down sitemap updating to 12 hours giving me time to moderate content, however this is not a good fix and could be greatly improved with a few rules based on the approval of moderated content.
Comment #2
wwhurley commentedThe following code adds a condition for whether the node is in the moderation queue. Since modr8 calls node_save the rule would be triggered on saving existing content. It should go into a file called modr8.rules.inc
<?php
/**
* Implementation of hook_rules_condition_info()
*/
function modr8_rules_condition_info() {
$items = array();
$defaults = array(
'arguments' => array(
'node' => array('type' => 'node', 'label' => t('Content')),
),
'module' => 'Node',
);
$items['rules_condition_content_is_moderated'] = $defaults + array(
'label' => t('Content is in moderation queue'),
);
return $items;
}
/**
* Condition: Check if the node is in the moderation queue
*/
function rules_condition_content_is_moderated(&$node, $settings) {
return $node->moderate == 1;
}
function rules_condition_content_is_moderated_label($settings, $argument_labels) {
return t('@node is in moderation queue', $argument_labels);
}
Comment #3
pandersb commentedI took the code above a little further and added an action: "Approve content". Since maintenance is unknown, I'd rather add this here than on in the Rules feature request.
I used this to approve referenced content when new content of a specific type is created.
NOTE: This does not add a log entry to the modr8 log reports. Someone else will have to continue with this.
(Add these 2 pages to [your_site]/sites/all/modules/rules/rules/modules)
Comment #4
mathankumarc commentedNew features are going into 7.x