Attached is a patch that adds a option for unique titles per OG rather than globally.

Seems to work for me so far in my limited testing.

CommentFileSizeAuthor
wikitools_og.patch4.83 KBmsonnabaum

Comments

jpmckinney’s picture

Status: Active » Needs work

Your patch assumes that og is enabled.

Also, I'm not sure if this should be part of wikitools, or its own module.

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-1.3

Using db_rewrite_sql would be one step in the right direction.

in: wikitools.module

@@ -383,12 +383,12 @@
       // There is at least one node type, so this will always be well-formed.
       $types_clause .= ')';
 
-      $nid = db_result(db_query("SELECT nid FROM {node} WHERE LOWER(title) = LOWER('%s') AND $types_clause", $node->title));
+      $nid = db_result(db_query(db_rewrite_sql("SELECT nid FROM {node} WHERE LOWER(title) = LOWER('%s') AND $types_clause"), $node->title));
       if (!$nid && wikitools_treat_underscore_as_space()) {
-        $nid = db_result(db_query("SELECT nid FROM {node} WHERE LOWER(REPLACE(title, '_', ' ')) = LOWER(REPLACE('%s', '_', ' ')) AND $types_clause", $node->title));
+        $nid = db_result(db_query(db_rewrite_sql("SELECT nid FROM {node} WHERE LOWER(REPLACE(title, '_', ' ')) = LOWER(REPLACE('%s', '_', ' ')) AND $types_clause"), $node->title));
       }
       if (!$nid && wikitools_treat_dash_as_space()) {
-        $nid = db_result(db_query("SELECT nid FROM {node} WHERE LOWER(REPLACE(title, '-', ' ')) = LOWER(REPLACE('%s', '-', ' ')) AND $types_clause", $node->title));
+        $nid = db_result(db_query(db_rewrite_sql("SELECT nid FROM {node} WHERE LOWER(REPLACE(title, '-', ' ')) = LOWER(REPLACE('%s', '-', ' ')) AND $types_clause"), $node->title));
       }
       // It is only an error if the node which already exists is not the currently edited node.
       if ($nid && $nid != $node->nid) {