After sending a newsletter manually cron reports the following error message:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'target_id_tids' in 'where clause': SELECT * FROM {field_data_field_newsletter_list} WHERE field_newsletter_list_target_id = :lid AND target_id_tids IS NOT NULL; Array ( [:lid] => 3 ) in NewsletterMail->getNodes() (Zeile 138 von /is/htdocs/wp10606582_4DZYNM0HHG/www/knowledgeandtrends.de/sites/all/modules/newsletter/includes/newsletter.mail.inc).
When trying to edit a subscriber I get the following error message:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'target_id_tids' in 'field list': SELECT target_id_tids FROM {field_data_field_newsletter_list} WHERE entity_id = :nsid AND field_newsletter_list_target_id = :nlid; Array ( [:nsid] => 3 [:nlid] => 2 ) in newsletter_get_default_exposed() (Zeile 231 von /is/htdocs/wp10606582_4DZYNM0HHG/www/knowledgeandtrends.de/sites/all/modules/newsletter/includes/newsletter.functions.inc).
I am just trying to set up the newsletter module so maybe I made a mistake (but tried to follow your instructions). Any help would be great - because this module seems to cover my requirements perfectly.
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedcan you check your database, if the table
field_data_field_newsletter_list
has the collumntarget_id_tids
?are you using mysql?if not, which one?
Comment #2
goetz2 CreditAttribution: goetz2 commentedThanks for your very fast response; yes, I am using MySQL ... and the table you mentioned does not have a field named target_id_tids; it has the following fields:
entity_type,bundle,deleted,entity_id,revision_id,language,delta,field_newsletter_list_target_id,field_newsletter_list_target_type
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedsomething went bad in the installation:/
when did you installed this module?
is it a long time ago?
if you disable , uninstall and then reisntall the module, does it work?
( be aware that you will lose your newsletter data if u uninstall..so if you have any subscribers backup your database first )
Comment #4
goetz2 CreditAttribution: goetz2 commentedI installed it yesterday - but just followed your advice, deactivation, deinstallation, new installation. The field target_id_tids is now in the table ;-))
Unfortunately I get a new error message when running cron:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND ((list.last_sent < node.created) OR (list.last_sent IS NULL )) ORDER BY ' at line 3: SELECT DISTINCT tax.nid AS nid, node.created AS created FROM {taxonomy_index} tax INNER JOIN {newsletter_list} list ON list.nlid = 1 INNER JOIN {node} node ON tax.nid = node.nid WHERE (tax.tid IN ()) AND ((list.last_sent < node.created) OR (list.last_sent IS NULL )) ORDER BY created DESC; Array ( ) in NewsletterMail->getNodes() (Zeile 146 von /is/htdocs/.../sites/all/modules/newsletter/includes/newsletter.mail.inc)
Thanks in advance for your advice!!! I really appreciate it
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedthis is a known bug,i will roll out a new release in a while that has the fix..
but i have to investigate how your installation missed the target_id_tids field, i hope i can reproduce it
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedComment #7
goetz2 CreditAttribution: goetz2 commentedThanks a lot
Comment #8
ParisLiakos CreditAttribution: ParisLiakos commentedcant reproduce it,and noone else seems to have this problem,so closing it
Comment #9
yeaha CreditAttribution: yeaha commentedHi, i had the same basic error of 'Column not found: 1054 Unknown column 'target_id_tids' in 'where clause'" it seems like the newsletter_schema_alter() function did not execute during installation.
Comment #10
ParisLiakos CreditAttribution: ParisLiakos commenteddid reinstalling fixed it?
anything that could assist reproducing this?
i must add a test on this asap
Comment #11
yeaha CreditAttribution: yeaha commentedreinstalling fixed it indeed, don't know how to reproduce this
Comment #12
Robin Millette CreditAttribution: Robin Millette commentedI had the last release installed. Then I saw all the interesting commits and updated to latest dev.
The function responsible for adding the target_id_tids column is in the .install:
But it's never called from any of the newsletter_update hooks.
Disabling, uninstalling and reenabling the module worked.
Comment #13
Robin Millette CreditAttribution: Robin Millette commentedComment #14
ParisLiakos CreditAttribution: ParisLiakos commentedHello Robin.
It is called in hook_install()
Should i also call it on every hook_update() as well?
Comment #15
Robin Millette CreditAttribution: Robin Millette commentedWhat's called hook_install() ?
One of the newsletter_update_71XX() function should alter the schema.
For more info, see
Comment #16
ParisLiakos CreditAttribution: ParisLiakos commentedfunction newsletter_install lines 53-61
and it is there since beta1 iirc
Comment #17
milos.kroulik CreditAttribution: milos.kroulik commentedSadly, reinstalling didn't help in my case. I recorded error at:
http://youtu.be/bLj_p2jTMSE
Could you, please, provide SQL, which I can try to correct the database?
Comment #18
wolfram CreditAttribution: wolfram commentedi can reproduce it
7.x-1.0-beta8 on a drupal 7.15 like this:
to solve the problem mentioned in http://drupal.org/node/1724112
you have to resave some fields
after the installation of 7.x-1.0-beta8
in the table "field_data_field_newsletter_list" the collumn "target_id_tid" is there
after resave:
admin/config/media/newsletter/subscribers/fields
field_newsletter_list -> edit/save
the collumn "target_id_tid" in the same table gets lost
in my tests it doesn't matter if you apply patch #4 in http://drupal.org/node/1724112 or not
the colume gets lost
Comment #19
ParisLiakos CreditAttribution: ParisLiakos commentedThats weird, i just tried and collumn remains there.
wolfram are you on mysql?