After create a new newsletter content, I get this error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tid' cannot be null: INSERT INTO {simplenews_newsletter} (nid, vid, tid, status) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 30 [:db_insert_placeholder_1] => 29 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 0 ) in simplenews_newsletter_save() (line 2406 of /www/htdocs/v100333/cms/sites/all/modules/simplenews/simplenews.module).
I'm using a fresh installation with ctools, devel, simplenews & views.
Comment | File | Size | Author |
---|---|---|---|
#17 | error---The website encountered an unexpected error. Please try again later.jpg | 40.23 KB | Francewhoa |
#11 | tid_cannot_be_null-1202850-11.patch | 780 bytes | ram4nd |
Comments
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedDid you choose a newsletter term during content creation ?
Comment #2
picsofle CreditAttribution: picsofle commentedThats another problem. I have created 2 terms for newsletter, but I can't select anyone. No terms are displayed.
Comment #3
Simon Georges CreditAttribution: Simon Georges commentedDid you add the Newsletter field to your content type ?
Comment #4
picsofle CreditAttribution: picsofle commentedNewsletter field is added to content type. Vocabulary and terms are created.
Comment #5
miro_dietikerDid you assign the vocabulary with the newsletter configuration to be used as newsletter definition?
Comment #6
Simon Georges CreditAttribution: Simon Georges commentedComment #7
BerdirClosing old bug reports with no feedback. If you still experience this, please test with the most recent dev snapshot first.
Comment #8
ShaneOnABike CreditAttribution: ShaneOnABike commentedFor the record I had the same issue but by resaving the Field and setting a default it seems have resolved the issue. I think for my case it might have been caused when this was migrated from D6, and something was out of synch.
Comment #9
ggeczy CreditAttribution: ggeczy commentedThank you so much ShaneOnABike - I've been through a half dozen issue pages here before I found your comment at the end of this one, this is the only solution that resolved the problem for me. I never migrated from D6 but clearly something was mixed up. As a summary I had to delete the "Newsletter category" field and recreate it, and then the Newsletter types started showing up properly.
Comment #10
Marko B CreditAttribution: Marko B commentedI had the same problem, opening field setting, choosing default taxonomy term and saving seems to solved this.
Comment #11
ram4nd CreditAttribution: ram4nd commentedComment #12
miro_dietikerFixing code happens in -dev.
ram4nd, there's no need to spam issue queues for attribution requests. Maintainers know how to do this and do this in case attribution appropriate.
Finally, please write a test or at least provide exact setup (mysql?postgres?) about how to trigger this bug.
Comment #13
ram4nd CreditAttribution: ram4nd commentedFixing code happens in dev, but maybe version can be helpful.
Well in my experience a lot of maintainers don't know that.
It's a huge site, that has many modules and has been upgraded since drupal 7.8. It would be hard to pinpoint the problem. But I can say that it happened while I was running migrate script. Also it happens on feeds import. It seems like the simplenews term is put to entity no matter what. It might has to do something with it being required. I will respond if I will have to dig in it more. I don't have time to look at it that closely.
Comment #14
miro_dietikerYes, you will need to provide a exact description to fix this bug.
Also, attribution only happens if ALL the patch work was done by you. If a maintainer needs to fix certain aspects, is a combined work and common to not attribute.
Here in concrete, if someone else provides tests in the same issue, you won't get the attribution. As with core, mentions (in commit messages) are the main instrument.
So if you want an attribution, you better perfectly describe the problem, provide a failing test outlining the issue, provide a fix, thus providing code on the quality level of a real maintainer. I'm looking forward to your inputs!
Comment #15
parraccourci CreditAttribution: parraccourci commentedI had the same issue. I wanted to be able to send newsletter only for some nodes. So I checked the "simplenews" checkbox in the "publishing options" but I unchecked the "required field" in the newsletter category field. So the simplenews field can be empty. The patch solved my problem.
Comment #16
PolThe patch fix the problem with 7.x-1.x, if you upgrade to 7.x-2.x, the problem is gone.
Comment #17
FrancewhoaThis is to confirm this error
Steps to reproduce
or
Chromium 57.0.2987.98
/node/add/simplenews
We'll post another comment here later about the suggested resolution
Comment #18
BDuell CreditAttribution: BDuell at Ubertus.org commentedThe patch for #11 has not been applied yet for 7.x-1.x and 7.x-1.x-dev but fixes the issue.
Thank you, ram4nd!
Comment #19
FrancewhoaHi miro_dietiker :) Thanks for all your maintainer contributions
The requested steps to reproduce this bug/challenge are into this comment #17 above
The requested suggested steps to resolve this challenge are into this comment #18 above.
Thanks to ram4nd for the patch in comment #11 :) And thanks to Brad, parraccourci, and Pol for testing it :) I also tested this patch with the most recent simplenews dev version, I can confirm that patch resolved the challenge.
As module maintainer, if you agree with this suggested resolution above, do you have everything you need to commit the patch in #11?
Comment #20
Francewhoa@Francewhoa :) This is a note to myself. I added this related ticket. For easier navigation about comment #17 above step to "Upgrade from Drupal core 7.44 to 7.52".