Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I check "sticky" or "promote to front" and update a forum node, it disappears from the forum because it doesn't update the vid in the forum table. When I manually edited the node's vid in the forum table to match the revision, it appears again.
I'm not sure where this happening since, I'm not familiar with the revision system yet. Anyhow, I believe it's in not in the forum_update() because the $node->vid is constructed before updating the forum record.
Give me a few pointers and I'd be glad to explore and hopefully submit a patch.
Comment | File | Size | Author |
---|---|---|---|
#14 | forum_db_pgsql.diff | 1.77 KB | Cvbge |
#10 | forum_db.patch | 1.33 KB | killes@www.drop.org |
#4 | forum.module_8.patch | 817 bytes | mfb |
Comments
Comment #1
jibrael CreditAttribution: jibrael commentedHi, I tried to replicate this but was unable to, I both promoted the forum topic and made it sticky. It remained visible in the forum, could you post some more info.
I did notice that if you promote or make sticky a forum topic, and then edit it, sticky and promotion is removed, is this by design?
Thanks
Comment #2
John Hwang CreditAttribution: John Hwang commentedI believe the setting being deleted is a bug in the form api partially because it's not complete in the beta 3.
It might be fixed in HEAD.
I'm not sure what other information to give... The only difference between my installation and a stock beta3 would be that I installed Korean locale... other than that it shouldn't matter shouldn't it?
Anyways... Is this true for other people too? Is sticky / promote to front working for others?
Comment #3
mfbI could not reproduce this behavior using HEAD.
However, when I checked "create new revision" I get
user warning: Duplicate entry '1' for key 1 query: INSERT INTO forum (nid, vid, tid) VALUES (1, 2, 2) in /usr/local/www/data/head/includes/database.mysql.inc on line 124.
This warning can be reproduced each time I save the forum node with "create new revision" checked.
The "create new revision" setting is forgotten between edits and always disabled. The other publishing options are remembered.
Comment #4
mfbHere is a patch which updates the vid so forum looks for the latest version of a node, and only inserts into the forum table when creating a new forum topic.
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedThe idea of versioning the forum table is to allow tracking of moved topics. The patch removes this feature. What needs changing is the structure of the database keys,
We currently have:
PRIMARY KEY (nid),
KEY vid (vid),
KEY tid (tid)
We probably should have:
PRIMARY KEY (nid, vid)
KEY(tid)
Comment #6
mfbAh I was looking in the wrong place ;) Looks like this schema change does the trick without any code changes.
Comment #7
mfbThe only bug I see now is if I revert a topic back to an older revision, the node gets the wrong tid in the term_node table. It gets tid 1, which is a container on my site, instead of the appropriate forum term id. The tid in the forum table is correct.
Comment #8
mfbThis term_node bug is actually a separate bug which affects all node types (i.e. not a forum module bug). the term_node.tid always reverts to "1" when the node is reverted.
Comment #9
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedmfb: Will you provide a database update?
Comment #10
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedActually, if you have a system that was updated from 4.6 you will not have thise db problem as the update handles it correctly and makes vid the primary key. The question is if we should make an update for the people creating a cvs site after the revisions patch. The attached patch does only fix the db definitions.
Comment #11
chx CreditAttribution: chx commentedno. development databases are to be deleted if something is broken. i expressed this opinion more than once.
Comment #12
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedOk, then this is ready to go.
Comment #13
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #14
Cvbge CreditAttribution: Cvbge commentedPostgresql only changes.
1. Original patch didn't change index name.
2. Postgresql updates added PK on nid, as it was defined in the database schema.
Related bug: http://drupal.org/node/35548
I need to test this patch, and also second issue mentioned in the 35548 might need to be fixed.
Comment #15
Cvbge CreditAttribution: Cvbge commentedTested, works.
Comment #16
moshe weitzman CreditAttribution: moshe weitzman commentedComment #17
sushil gupta-dupe CreditAttribution: sushil gupta-dupe commentedDescriptionDescriptionDescriptionDescriptionDescriptionDescription Description Description Description Description.
Comment #18
(not verified) CreditAttribution: commented