Closed (fixed)
Project:
Content moderation
Version:
6.x-1.2
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
12 Apr 2010 at 09:59 UTC
Updated:
18 Apr 2010 at 12:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
eugenmayer commentedDo we expect any sideeffect when revisions will set live? i mean, actually tnid is in the node table, so iam not sure why it is affected by the content_moderation module at all?
So actually why do we even lose tnid at all? I need to clarify this so we can think about sideffects. If there are no, i will gladly include your patch!
Comment #2
weseze commentedI can't find the reason why the tnid is lost... I can only assume it has somthing to do with copying/cloning the node. If I find some more time today, I'll look into it.
Comment #3
weseze commentedComment #4
weseze commentedI've done some more work on this. Turns out my patch is wrong. :)
The tnid is not lost if you edit revisions that already have a tnid link. The tnid is only lost when you create new translations.
The problem starts in content_moderation_nodeapi in the insert-case. (content_moderation.module line 152) The $node object passed in here does not contain a valid tnid. Instead it contains an translation_source object. This object contains the source node.
I noticed that the function _content_moderation_create_pending_revision() is called and that function calls the node_save() function.
Strange comment here, so I assume this is the cause of the problem :)
The patch to fix the bug with the tnid being lost:
I'm not really sure how all the code in the insert-case works and what it does exactly, so this patch might not fix the real problem.
EugenMayer: Could you explain why you are saving a clone of the node?
Comment #5
eugenmayer commentedIam investigating the code right now. Quick answers:
Could you explain why you are saving a clone of the node?:
Well when you create a moderated node-type you see a kind of "template" ( this node has no live-versions yet).
The "real" created content fo the node is in a revision. So after inserting a node we already have 2 revisions, the template one and the "real one" pending. Thats why i actually call save manually and thats where we run into problems.
Comment #6
weseze commentedCan you have a look at this patch? I changed the logic from saving a cloned node, to just saving a new revision of the exisiting node. It seems to work fine for me.
Comment #7
weseze commentedHmm, I patched against my previous patch :)
Here's one against the official 1.2:
Comment #8
eugenmayer commentedWell sorry, i just reworte the main parts of content_moderation. That whole part of "fake live revision" is completely removed. It makes just to maybe problems and has nearly no extra use.
Now, when you create a new node, you get a warning that there is no approved one. This is even more straight then the way before, which even had a "live" version without having a live history for this at all (comparing history and the block informations).
I pretty much changed the way the nodeapi method works. I also fixed all the problems concerning tnid / path alias and so forth and some other bugs yet did not got digged out.
Comment #9
eugenmayer commentedhttp://github.com/EugenMayer/content_moderation/tree/rewrite
Here you can see the new code. It would be great if you could test it so we get near the final.
Comment #10
eugenmayer commentedComment #11
eugenmayer commentedComment #12
eugenmayer commentedreleased in 1.3