Commit 1200fb63 authored by damiankloip's avatar damiankloip Committed by tim.plunkett
Browse files

Issue #1527778 by damiankloip: View::save needs to check for machine name...

Issue #1527778 by damiankloip: View::save needs to check for machine name before saving. Not reliant on vid only.
parent 7dd3f314
......@@ -1828,6 +1828,11 @@ function save() {
if ($this->vid == 'new') {
$this->vid = NULL;
}
// If there is no vid, check if a view with this machine name already exists.
elseif (empty($this->vid)) {
$vid = db_query("SELECT vid from {views_view} WHERE name = :name", array(':name' => $this->name))->fetchField();
$this->vid = $vid ? $vid : NULL;
}
$transaction = db_transaction();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment