Hello,
While reading the module's code, to find out how something works, and I read this code, around line 821:

// If this node has been upublished, the ad should no longer be active.
if ($node->status != 1 && $node->adstatus == 'active') {
  $node->adstatus = t('unpublished');
}
// If a previously unpublished node has been published, reactivate the
// the ad.
else if ($node->status == 1 && $node->adstatus == 'unpublished') {
  $node->adstatus = t('active');
  // Special "publish" event, may as well track it even though we'll
  // next also record an "active" event.
  ad_statistics_increment($node->nid, 'publish');
}

See the lines $node->adstatus = t('unpublished'); and else if ($node->status == 1 && $node->adstatus == 'unpublished') {

They cannot work together in a multilingual website: if the word "unpublished" is translated, then its translation may get put in base, and the expression $node->adstatus == 'unpublished' may return false although the node is realy unpublished, but the value is, say, its French translation.

I think this must be corrected but don't know what are all the consequences of such a change.

Regards,
David

Comments

jeremy’s picture

Assigned: Unassigned » jeremy
Status: Active » Fixed

Thanks for taking the time to review the code and report this bug, David, you are correct. I have committed a fix for this bug in the 5.x development branch. (I had to fix several other instances of this bug at the same time.)

jeremy’s picture

Fix committed to the 6.x development branch, too.

Status: Fixed » Closed (fixed)

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