When I run a cron manually from the Status Report screen, I get the following error:
* user warning: Duplicate entry '8' for key 'PRIMARY' query: INSERT INTO node_expire (nid, expire, expired) VALUES (8, 0, 0) in /mydomainname/includes/common.inc on line 3422.
* user warning: Duplicate entry '9' for key 'PRIMARY' query: INSERT INTO node_expire (nid, expire, expired) VALUES (9, 0, 0) in /mydomainname/includes/common.inc on line 3422.
* user warning: Duplicate entry '10' for key 'PRIMARY' query: INSERT INTO node_expire (nid, expire, expired) VALUES (10, 0, 0) in /mydomainname/includes/common.inc on line 3422.
* user warning: Duplicate entry '11' for key 'PRIMARY' query: INSERT INTO node_expire (nid, expire, expired) VALUES (11, 0, 0) in /mydomainname/includes/common.inc on line 3422.
Comment | File | Size | Author |
---|---|---|---|
#8 | node_expire_diff.patch | 1.13 KB | arthurf |
#7 | node_expire-426636-7.patch | 765 bytes | smsearcy |
#6 | node_expire-426636-6.patch | 737 bytes | smsearcy |
#5 | node_expire-426636-5.patch | 435 bytes | smsearcy |
Comments
Comment #1
marioe2000 CreditAttribution: marioe2000 commentedSame problem here... only difference is that I get it for only two records.
Comment #2
zarudnyi CreditAttribution: zarudnyi commentedSame problem
Duplicate entry '506' for key 1 query: drupal_write_record /* Administrator : drupal_write_record */ INSERT INTO node_expire (nid, expire, expired) VALUES (506, 0, 0) in /home/folder/data/www/domain/includes/common.inc on line 3422.
Comment #3
smsearcy CreditAttribution: smsearcy commentedTry changing the code at line 53 in node_expire.nodeapi.inc from:
to
It wasn't properly detecting if it was editing an existing record.
Comment #4
zarudnyi CreditAttribution: zarudnyi commentedHi, smsearcy!
Thanks for your reply.
You code work fine, my problem is completely solved.
Comment #5
smsearcy CreditAttribution: smsearcy commentedHere's a patch for code change in comment #3. I think I created it correctly, please let me know if there is a problem.
Comment #6
smsearcy CreditAttribution: smsearcy commentedI ran into an issue with my previous patch of not being able to add an expiration date to an existing node without an expiration date (I think because it was attempting to update a non-existent record in {node_expire}), so I rewrote the insert/update section. This hopefully will also address #466680: Nodes saved in node_expire table with value of 0 then unpublished by not saving an empty expiration date in the table (and will clean up the table).
I've attached a patch, which hopefully is correctly formatted (I'm stuck running Windows).
Comment #7
smsearcy CreditAttribution: smsearcy commentedMinor formatting change to previous post, and removed the second point from the case statement.
Comment #8
arthurf CreditAttribution: arthurf commentedHere's a slight variation on the above patch- removes the the $update array and uses the drupal_write_record fuction instead of the db_query. It also prevents makes the delete query conditional. I'm not sure if there is ever a condition where this would be the case, but seems like it might be a good idea to check for it.
Comment #9
barckhoff CreditAttribution: barckhoff commentedExcellent! Thank you so much for posting this -- I installed the arthurf patch (#8 above) and it seems to be working for me.
Any idea how to stop node expire from subtracting a day from the expiration date every time a node is edited? (See http://drupal.org/node/435658)
Comment #10
smsearcy CreditAttribution: smsearcy commentedI tested arthurf's patch (#8) when adding/modifying/deleting expiration dates on new and existing nodes and didn't find any issues. Thank you.
Comment #11
p4trizio CreditAttribution: p4trizio commentedHi guys! Isn't it time to make a new release of this module? With all this patches... I'm lost! ;-)
Can someone post the MUST patches of this module? Just a simple list to make it work in a good way.
Thank you!
Comment #12
Summit CreditAttribution: Summit commentedHi, I think committing the working patches in a .dev would be the best way, because maybe there is also a working order for the patches to commit properly, right? Then after testing making a 2.04 or 2.1 please.
Thanks a lot in advance for considering this!
Greetings, Martijn
Comment #13
the.alphy CreditAttribution: the.alphy commentedI'm having this same error. How test/stable is the patch? Does anyone know when it will make it's way into 2.04/the next version?
Comment #14
JamesAn CreditAttribution: JamesAn commentedThe patch in #8 works for me too. I took a quick peek at the PHP code and it makes sense to me.
Maybe if we RTBC this, one of the committers will take notice.
Comment #15
the.alphy CreditAttribution: the.alphy commentedYeah, I tested the patch as well and it seems to fix the problem so far.
Comment #16
zapscribbles CreditAttribution: zapscribbles commentedSubscribe, I've been having the same issue
Comment #17
siliconmeadow CreditAttribution: siliconmeadow commentedJust to let you know, I too have run this patch (#8) five months since the last report and it worked fine. I guess it's reassuring that the patched code hasn't gone stale in that time.
:-)
Comment #18
fletch11 CreditAttribution: fletch11 commentedI'm still getting this meassage. Has this been applied to the latest version?
Comment #19
opteronmx CreditAttribution: opteronmx commentedConfirmed, #8 arthurf's Patch applied against current stable version, works fine, cron errors gone away!
Thanks arthurf
Comment #20
Mac Clemmens CreditAttribution: Mac Clemmens commentedSame problem. #8 worked for me. Thanks!
Comment #21
vikramy CreditAttribution: vikramy commentedFixed.. Thanks for the patch..