Error due to no search type restriction in nodes with same project title
This commit is contained in:
parent
7eaffe9bbb
commit
183372ebe3
1 changed files with 5 additions and 1 deletions
|
@ -728,7 +728,11 @@ function stormproject_nodeapi(&$node, $op, $teaser, $page) {
|
|||
case 'validate':
|
||||
$nid = $node->nid;
|
||||
// Checking if there is another project with the same name:
|
||||
$project_nid = db_result(db_query("SELECT nid FROM {node} WHERE title = '%s'" . (isset($nid) ? " AND nid != $nid" : ''), $node->title));
|
||||
$project_nid = db_result(
|
||||
db_query(
|
||||
"SELECT nid FROM {node} WHERE type = 'stormproject' AND title = '%s'" . (isset($nid) ? " AND nid != $nid" : ''), $node->title
|
||||
)
|
||||
);
|
||||
if (!empty($project_nid)) {
|
||||
form_set_error('title',
|
||||
t('Already exists a !project with this name. Please check!',
|
||||
|
|
Reference in a new issue