After trying to use the scheduler module to schedule automatic status changes I started getting this error (see below). I think the exact time it started happening is when I set a newsletter to be sent on a node that was scheduled to publish in the future (so the node was in unpublished). Even after the node moved to published status, the error was still an issue. Because I disabled scheduler and am still received this error it may not be related to that module. My cron jobs "exceed the run limit" and "abort" every time and produced the error:

user warning: Unknown column 'status' in 'field list' query: SELECT tid, status, timestamp, source FROM simplenews_snid_tid t WHERE t.snid = 4 in /sites/all/modules/simplenews/simplenews.module on line 1249.

I was running the Simplenews 6.x-2.x-dev build on drupal 6.16 with http://drupal.org/project/scheduler 6.x-1.6 running on a Linux server. When I moved back to the non-dev build (6.x-1.1) the issue went away. So, I'm happy, but I thought you would want to know. Let me know if you need further testing on this and I'll see what I can do (it's a live site, so I need to be careful).

CommentFileSizeAuthor
Picture 6.png28.84 KBlindsay

Comments

sutharsan’s picture

Even when the node is unpublished, when you save with 'send' simplenews will send the node. Dis you run update.php when you moved to 6.x-2.x-dev?

sutharsan’s picture

Category: bug » support

To find the cause I need more info. Without additional information my conclusion is that the error is caused by not running update.php

eriknewby’s picture

Title: "Unknown column 'status' in 'field list' query", causes cron to time out and wont send mail » "Unknown column 't.status' in 'where clause' query", wont send mail
Category: support » bug

I am getting a very similar error. So I'd like to reopen to see if this makes sense.
I upgraded from 1.3 to 2.x-dev. I ran update (via drush and via update.php), though both stated that there aren't any updates required.
Message from dblog = Unknown column 't.status' in 'where clause' query: SELECT s.mail FROM simplenews_subscriptions s INNER JOIN simplenews_snid_tid t ON s.snid = t.snid WHERE s.activated = 1 AND t.tid = 19 AND t.status = 1 in /path/to/my/modulesfolder/simplenews/simplenews.module on line 1522.

eriknewby’s picture

On further inspection, the column "status" indeed does not exist in my "simplenews_snid_tid" table. Running update does not alter it either.
Removing "AND t.status = %d" on line 1521 of simplenews.module resolved the error, but emails still do not get sent. (Obviously removing this wouldn't be the answer)
On another thread, user held69 experienced a very similar error after upgrading. http://drupal.org/node/690412#comment-2900720

eriknewby’s picture

Status: Active » Closed (fixed)

I will close this as it is definitely just an update issue. I manually wrote the sql table for simplenews_snid_tid and included the new columns.

If anyone else has this issue, here is the table:

CREATE TABLE `simplenews_snid_tid` (
`snid` int(11) NOT NULL DEFAULT '0',
`tid` int(11) NOT NULL DEFAULT '0',
`status` smallint(6) NOT NULL DEFAULT '1',
`timestamp` int(10) unsigned NOT NULL DEFAULT '0',
`source` varchar(24) NOT NULL DEFAULT '',
PRIMARY KEY (`snid`,`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Sending works again. All is well now.
Thank you.

funknut’s picture

Status: Closed (fixed) » Active

I just updated from 1.x to 2.x and had this same issue. Update.php did not see any updates. This seems like a bug, so I'm opening it again.

miro_dietiker’s picture

Status: Active » Closed (duplicate)

This is duplicate to:
[823688]
Note that it is quite common that a -dev has not yet implemented a upgrade path.

If someone of you could provide the right ALTER statement for this upgrade, the fix could happen faster and within less time.

RayAdams23’s picture

Could I ask where you actually where to apply this code?

Nicolas Bousselet’s picture

I wrote like you in the table simplenews_snid_tid the new columns, so the error disappear but I don't receive my newsletter again... may be you have a solution...?