Closed (outdated)
Project:
Content Optimizer
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2010 at 06:09 UTC
Updated:
14 Jun 2017 at 20:12 UTC
Jump to comment: Most recent
Comments
Comment #1
TomDude48 commentedWhat database are your running? I found an issue reported with the db_affected_rows and changed that line to the recommendation. I can't test it though because it works with my version of MySQL.
I have committed the change to dev. So try that version and let me know if the problem persists.
Tom
Comment #2
drupaledmonk commentedI am using Mysql 5.0. I will give it a try and see if it is working fine now.
Comment #3
TomDude48 commentedno response, assumed working fine
Comment #4
drupaledmonk commentedsorry I didn't follow up on this issue, was busy with other things. Yes it is working fine on mysql 5.0 Great module!!
Comment #5
floown commentedHello,
I have the same bug. I have mysql-client-5.1 installed on a Ubuntu 10.10 server. Do you think to resolve this warning for Mysql 5.1 ?
Thx for this usefull module.
Comment #6
TomDude48 commentedThe fix works for me on MySQL 5.1 however, the fix was only in the dev version. I updated the revision to 2.2 to get it into the official release.
If you try that one it should fix the problem.
Comment #8
aknapstein commentedReopened: I have the same problem with module version 6.x-2.2.
Error message: User warning: Duplicate entry '1' for key 'PRIMARY' query: INSERT INTO contentoptimizer (aid,keyword) VALUES (1,'MYKEYWORD') in _db_query()
I'm using pressflow 6.22, mysql client 5.1.41 (mysqli)
Comment #9
bensnyder commentedSame ^^
Comment #10
jazzdrive3 commentedGetting the same error using 2.2. Any updates? Using in regard to the whole SEO Tools module.
Comment #11
Jonathan Peterson commentedI suffered from this same problem.
Some surfing around led me to http://drupal.org/node/805858, the long and the short of which is that my particular MySQL library is such that the call to db_affected_rows is returning zero when the keyword has not changed. (Content optimizer is expecting that db_affected_rows should return 1 if there is already an entry in the table with that particular aid.)
This function uses the same pattern as variable_set does, the relevant code of which is:
Note the at sign in the second call to db_query. This silences the warnings. Thus I made the same change to contentoptimizer.module, specifically:
Hope this helps.
Comment #13
rsvelko commentedI have a non latin website with contentoptimizer 6.x 2.2
I get the same type of error.
Here is the code my site runs:
I noticed that the error is ike this :
user warning: Duplicate entry '0' for key 'PRIMARY' query: INSERT INTO dr_contentoptimizer (aid,keyword) VALUES (0,'') in /var/www... sites/all/modules/contentoptimizer/contentoptimizer.module on line 84.
which means php is trying to update/insert with an empty '' $keyword variable...
The fix is to add a check for emptyness:
Comment #14
rsvelko commentedtested - no more errors
yay!
Comment #15
castawaybcn commentedsolution in #11 fixed it for me, thanks!
Comment #16
b-reid commentedI am closing this issue because Drupal 6.x has reached EOL and is no longer supported as of February 26th, 2016.