diff --git a/_get_instance_details.php b/_get_instance_details.php
index 9068977..f616002 100644
--- a/_get_instance_details.php
+++ b/_get_instance_details.php
@@ -98,7 +98,7 @@ $instance = $engine->getActiveInstanceForSubject($process['code'], $subject_type
$instanceData = $instance['data_json'] ? json_decode($instance['data_json'], true) : [];
?>
-
+
@@ -108,10 +108,10 @@ $instance = $engine->getActiveInstanceForSubject($process['code'], $subject_type
-
\s*",
+ lambda m: checklist_replacement,
+ content,
+ flags=re.DOTALL
+)
+
+form_replacement = """ """
+
+content = re.sub(
+ r"",
+ lambda m: form_replacement,
+ content,
+ flags=re.DOTALL
+)
+
+with open('_get_instance_details.php', 'w', encoding='utf-8') as f:
+ f.write(content)
+print("File _get_instance_details.php patched successfully.")
\ No newline at end of file
diff --git a/patch_script2.py b/patch_script2.py
new file mode 100644
index 0000000..3728e13
--- /dev/null
+++ b/patch_script2.py
@@ -0,0 +1,23 @@
+import re
+
+with open('_get_instance_details.php', 'r', encoding='utf-8') as f:
+ content = f.read()
+
+def replace_checkbox(m):
+ block = m.group(0)
+ return re.sub(
+ r'\n .*?<\?php else: \?>",
+ replace_checkbox,
+ content,
+ flags=re.DOTALL
+)
+
+with open('_get_instance_details.php', 'w', encoding='utf-8') as f:
+ f.write(content)
+print("Hidden inputs added.")
diff --git a/patch_script3.py b/patch_script3.py
new file mode 100644
index 0000000..a96114b
--- /dev/null
+++ b/patch_script3.py
@@ -0,0 +1,13 @@
+import re
+
+with open('_get_instance_details.php', 'r', encoding='utf-8') as f:
+ content = f.read()
+
+content = content.replace('name="= htmlspecialchars($fieldName) ?>" name="= htmlspecialchars($fieldName) ?>"', 'name="= htmlspecialchars($fieldName) ?>"')
+
+# Also fix the trailing slash from my earlier mistake `` just to make it clean `>`
+content = content.replace('= (!empty($currentValue) || (!isset($instanceData[$fieldName]) && !empty($field["default"])) ? "checked" : "" ?>/>', '= (!empty($currentValue) || (!isset($instanceData[$fieldName]) && !empty($field["default"])) ? "checked" : "" ?>>')
+
+with open('_get_instance_details.php', 'w', encoding='utf-8') as f:
+ f.write(content)
+print("Cleaned up duplicates.")