FAQ items not being created after using form
| Project: | Frequently Asked Questions |
| Version: | 5.x-2.12 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
I have two environments that are setup exactly the same (test and prod). When I ask this question in test it is posted, but in prod it isnt... :
Mr. snip, We here at the snip Site need your help. No one here seems to care, or wants to tell us the truth. Please help save the jobs of the snip, the writing is pretty much on the walls that we will be outsourced. All other units/dept. have a manager on their side to justify and save their jobs. We have an "Interim Manager" that is selling us out. Please Help we all have families to feed, and have dedicated many years of service to snip. Thank You!!!
HTML filter is off in both environments. Nothing shows up in the log entries except for expert notification sent. I check the list of FAQ items and it isn't there. The expert notification link to answer question results in page not found. I don't know where else to look, this is the exact same module version as in test (we copied environments from test->prod) following the drupal migration guide.
Help/ideas greatly appreciated

#1
I've confirmed that MySQL 5.1.* has fault tolerance built-in that 5.0.* does not. FAQ_Ask tries to insert the question body into the title as well and it is not truncated to title's maximum char limit of 128 which results in the query failing but no report being added to the drupal logs. I'm now going to explore the code and offer a patch if anyone else has noticed this issue and/or is suffering from it...
#2
This appears to be an issue of FAQ and not FAQ_Ask
#3
Is this issue fixed in 2.x?
#4
Spoke with stella via IRC about this issue. Appears only to be a D5 issue. What i've found:
On a new question submitted with both FAQ and FAQ Ask forms: if question is longer than 128 chars inserts fail in mysql DB's with strict mode enabled. Non strict mode truncates node.title and node_revisions.title and there are no problems as the entire question is stored in faq_questions.question
Since it is OK for questions to be truncated in the node and node revisions tables (they display properly on views because question pulled from faq_questions.question instead of node*) I have created 4 triggers to handle the truncation and avoid too large for column errors:
CREATE TRIGGER node_shrtn_ttl_ins BEFORE INSERT ON node FOR EACH ROW SET NEW.title = SUBSTR(NEW.title,1,128);
CREATE TRIGGER node_shrtn_ttl_upd BEFORE UPDATE ON node FOR EACH ROW SET NEW.title = SUBSTR(NEW.title,1,128);
CREATE TRIGGER node_rev_shrtn_ttl_ins BEFORE INSERT ON node_revisions FOR EACH ROW SET NEW.title = SUBSTR(NEW.title,1,128);
CREATE TRIGGER node_rev_shrtn_ttl_upd BEFORE UPDATE ON node_revisions FOR EACH ROW SET NEW.title = SUBSTR(NEW.title,1,128);
This works fine until the code base is updated to properly limit questions to 128 chars for "title" in node/node_revisions
#5
These triggers do not work on the strict table, the too large for column error occurs before the trigger has a chance to reduce it
#6
Would you please port the way the D6 version works to D5 to mitigate these issues?
#7
I've looked into this, and with the way node_save() is implemented in Drupal 5 I don't really see a workable solution that i can implement in the faq module. Since Drupal 5 will no longer be supported once Drupal 7 is released in just a few months time, I think for now you will have to use a non-strict mysql mode or implement triggers like you have already done. I've updated the known issues page with this info.