From fc38d02210008efe77320b812d062dbb0c990f5a Mon Sep 17 00:00:00 2001
From: Agnibho Mondal <mondal@agnibho.com>
Date: Sat, 22 May 2021 16:40:01 +0530
Subject: [PATCH] Bugfix

---
 lib/functions.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/functions.php b/lib/functions.php
index b02add6..782a5d6 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -48,7 +48,12 @@ function schema2form($file, $pid=null, $id=null, $cat=null, $data=null){
     if(isSet($prop->enum)){
       $form=$form."<select class='form-control' ".$req." name='".$field."' id='".$field."'>";
       foreach($prop->enum as $opt){
-        $form=$form."<option>".$opt."</option>";
+        if($opt==$value2){
+          $form=$form."<option selected>".$opt."</option>";
+        }
+        else{
+          $form=$form."<option>".$opt."</option>";
+        }
       }
       $form=$form."</select>";
     }
-- 
2.39.5