From 3bc304b844aeeea07a32ddc4dbf1aa417f2700e1 Mon Sep 17 00:00:00 2001 From: torleif Date: Mon, 18 Jul 2016 11:12:46 +1200 Subject: [PATCH] FIX: use correct ID if it exists. Fixes #133 --- code/model/Widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/Widget.php b/code/model/Widget.php index 20c8d09..7528d1e 100644 --- a/code/model/Widget.php +++ b/code/model/Widget.php @@ -217,7 +217,7 @@ class Widget extends DataObject $fields = $this->getCMSFields(); $outputFields = new FieldList(); - $this->FormID = $this->FormID ?: uniqid(); + $this->FormID = $this->ID ?: uniqid(); $outputFields->push(HiddenField::create('Widget[' . $this->FormID . '][FormID]', 'FormID', $this->FormID)->addExtraClass('formid'));