From 357b01edeaaefbb630901a69e9df1dd6d7fc7b98 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Fri, 10 May 2024 18:36:58 +0200 Subject: [PATCH] [BUGFIX] Fix confval default overrriding type (cherry picked from commit e353ee1e94893339954b585c42a209c378111e80) --- .../src/RestructuredText/Directives/ConfvalDirective.php | 2 +- .../tests/confval/confval-name/expected/another.html | 3 ++- .../Integration/tests/confval/confval-name/expected/index.html | 3 ++- .../tests/confval/confval-no-title/expected/index.html | 3 ++- .../tests/confval/confval-noindex/expected/another.html | 3 ++- .../tests/confval/confval-noindex/expected/index.html | 3 ++- .../tests/confval/confval-warning/expected/another.html | 3 ++- .../tests/confval/confval-warning/expected/index.html | 3 ++- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/guides-restructured-text/src/RestructuredText/Directives/ConfvalDirective.php b/packages/guides-restructured-text/src/RestructuredText/Directives/ConfvalDirective.php index 321622c9f..637796458 100644 --- a/packages/guides-restructured-text/src/RestructuredText/Directives/ConfvalDirective.php +++ b/packages/guides-restructured-text/src/RestructuredText/Directives/ConfvalDirective.php @@ -89,7 +89,7 @@ protected function processSub( } if ($directive->hasOption('default')) { - $type = $this->inlineParser->parse($directive->getOption('default')->toString(), $blockContext); + $default = $this->inlineParser->parse($directive->getOption('default')->toString(), $blockContext); } $noindex = $directive->hasOption('noindex'); diff --git a/tests/Integration/tests/confval/confval-name/expected/another.html b/tests/Integration/tests/confval/confval-name/expected/another.html index 05bf14fea..f45660ff2 100644 --- a/tests/Integration/tests/confval/confval-name/expected/another.html +++ b/tests/Integration/tests/confval/confval-name/expected/another.html @@ -6,8 +6,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-name/expected/index.html b/tests/Integration/tests/confval/confval-name/expected/index.html index 64ce88e77..57e65690d 100644 --- a/tests/Integration/tests/confval/confval-name/expected/index.html +++ b/tests/Integration/tests/confval/confval-name/expected/index.html @@ -6,8 +6,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-no-title/expected/index.html b/tests/Integration/tests/confval/confval-no-title/expected/index.html index 3a92d7bed..aa119b16f 100644 --- a/tests/Integration/tests/confval/confval-no-title/expected/index.html +++ b/tests/Integration/tests/confval/confval-no-title/expected/index.html @@ -6,8 +6,9 @@

Confval directive

-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-noindex/expected/another.html b/tests/Integration/tests/confval/confval-noindex/expected/another.html index 72aa4a6a8..dda852b5c 100644 --- a/tests/Integration/tests/confval/confval-noindex/expected/another.html +++ b/tests/Integration/tests/confval/confval-noindex/expected/another.html @@ -6,8 +6,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-noindex/expected/index.html b/tests/Integration/tests/confval/confval-noindex/expected/index.html index 64ce88e77..57e65690d 100644 --- a/tests/Integration/tests/confval/confval-noindex/expected/index.html +++ b/tests/Integration/tests/confval/confval-noindex/expected/index.html @@ -6,8 +6,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-warning/expected/another.html b/tests/Integration/tests/confval/confval-warning/expected/another.html index 345b79b63..546a44c3d 100644 --- a/tests/Integration/tests/confval/confval-warning/expected/another.html +++ b/tests/Integration/tests/confval/confval-warning/expected/another.html @@ -7,8 +7,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom
diff --git a/tests/Integration/tests/confval/confval-warning/expected/index.html b/tests/Integration/tests/confval/confval-warning/expected/index.html index 15252c32d..f4e79e2db 100644 --- a/tests/Integration/tests/confval/confval-warning/expected/index.html +++ b/tests/Integration/tests/confval/confval-warning/expected/index.html @@ -6,8 +6,9 @@

Confval directive

demo
-
Type: "Hello World"
+
Type: string
Required: true
+
Type: "Hello World"
Custom Info: custom