Skip to content
Snippets Groups Projects
Commit 1200fb63 authored by Damian Lee's avatar Damian Lee 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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment