under admin/content/modr8 I have "1 post in moderation" even if there is no node that is marked as moderated. The only nodes I have on the test system are two "usernodes", which are not moderated. which db tables are relevant for modr8? Maybe I have some leftover from deleted nodes which causes this...

Comments

pwolanin’s picture

The only table that is examined is the {node} table. Maybe another module is using the 'moderate' column for something?

Try running a query like

print(db_result(db_query("SELECT COUNT(*) FROM {node} WHERE moderate > 0")));
pwolanin’s picture

Category: bug » support

unless you can provide more info, I don't think this is a bug with the module

schnizZzla’s picture

Category: support » bug
StatusFileSize
new6.35 KB

IF the only table examined is the nodes table, it IS a bug:

schnizZzla’s picture

StatusFileSize
new15.23 KB

take a look at the 3 attached images

schnizZzla’s picture

StatusFileSize
new2.29 KB

3 images say more than 3 words ;-)

schnizZzla’s picture

the first shows the drupal's admin content view
the second shows the whole node table in phpMyAdmin
the third shows the resulting bug

this is a bug on my system, this is how testing modr8 started for me...

I don't care for the "one" as long as the count of "hidden" moderated content does not increase with more nodes on the system and as long the module works fine otherwise. Earlier or later I will try to fix this on my system myself, if it's still only my problem...

schnizZzla

ps the blacked out name is just the name of my superadmin, I don't want to publish it anywhere...

pwolanin’s picture

Clearly, there are no nodes in moderation.

So, here's the relevant code, and maybe the problem is in the call to format_plural(). As you can see, I hard-coded the count to zero there, but maybe I only tested this with the locale module off. This message is only displayed when there are zero posts in moderation, so the bug is really at the display level, not anything deeper.

/**
 * Menu callback; displays the content moderation form.
 */
function modr8_page() {
  require_once drupal_get_path('module', 'modr8'). '/modr8_admin.inc';
  
  $count_sql = db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE n.status = 1 AND n.moderate = 1');
  $page_sql = db_rewrite_sql('SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.moderate = 1 ORDER BY n.changed DESC');
  $result = pager_query($page_sql, variable_get('modr8_nodes_per_page', 10), 0, $count_sql);
  
  $output = '<p>'. l(t('Show log of all actions on moderated content.'), 'admin/logs/modr8') .'</p>';
  if (db_num_rows($result)) {
    $output .= drupal_get_form('modr8_form', $result);
    $output .= theme('pager');
  }
  else {
    $output .= '<p>'. t('@items in moderation', array('@items' => format_plural(0, '1 post', '@count posts'))). '</p>';
  }
  return $output;
}

schnizZzla’s picture

Priority: Normal » Minor

"so the bug is really at the display level, not anything deeper."

I already thought that this not a bug serios bug that causes inconsistensy or something.
I'm busy with other things now, I'm going to track this issue reporting later.

Thanks so far, for the fast response.

schnizZzla’s picture

Status: Active » Closed (fixed)

I don't know how, but it disappeared. The zombie is dead. I did not pay attention to this issue for some time, so I don't know how and why...

chemichon’s picture

Version: 5.x-2.2 » 6.x-1.1
Status: Closed (fixed) » Needs review

Hi,

I have the same thing. No node marked as moderate=1 on database, but module says I have one moderated node...

Thanks!

pwolanin’s picture

Status: Needs review » Active

no patch, no clear indication of the bug