Closed (fixed)
Project:
Revision Moderation
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2007 at 00:41 UTC
Updated:
17 Oct 2009 at 17:47 UTC
Is there a quick way to set all node of a give type so that their "Revision Moderation" flag is turn on? I just imported about 250 links node (a custom CCK node I made) but I just found out that I did not set that flag on those imported nodes. Is there a small PHP script I could run as a page node or some other method that would allow me to set retroactively this flag?
Thanks for your help.
Marc
Comments
Comment #1
jimmygoon commentedDo you have direct access to the database. Some SQL might cheer you up.
Comment #2
platypus media commentedI had to do the same thing. I had the database module installed so I could run a query directly on the database. I had a little trouble getting the syntax for nested queries so I did a cut and paste of
select nid, 1 from nodeand did a find and replace to put it into (nid,1) format, and just copied that into:
insert into revision_moderation values (nid1, 1), (nid2, 1), ... (nidn, 1)Worked like a charm.
Mike
Comment #3
webchickAh. In the future, I think you could do this a little easier with:
Kind of a funky syntax, but it should be cross-database compatible, unlike the multiple value pair syntax: http://dev.mysql.com/doc/refman/5.1/en/ansi-diff-select-into-table.html
Comment #4
webchickComment #5
(not verified) commentedComment #6
bowersox commentedHere is an error-resistant version of the code in #3:
The first line deletes all revision_moderation flags for nodes of type page, story, or book. The second line re-inserts a revision_moderation=1 flag for all nodes of these 3 types. This will force all nodes to use revision_moderation.
The version of the code in #3 might give an error if you have some nodes in your database that have been created with a revision_moderation flag already. You might get an error like "ERROR 1062 (23000): Duplicate entry '252' for key 1".
The SQL above has only been tested on MySQL and may not run on other databases.
What types have revision moderation enabled by default?
This query looks in the variable table to check the node_options_TYPE settings and return a list of types with revision_moderation enabled by default.
What types have at least one node with revision moderation enabled?
This query looks in the revision_moderation table to see what node types have one or more revision_moderation=1 flags.