From 9a41fe0ebe04b15344a0899ddb31ade168480ed4 Mon Sep 17 00:00:00 2001 From: Peter Lohse Date: Thu, 19 Oct 2023 17:16:54 +0200 Subject: [PATCH 1/4] primary key --- files/acp/database/install_dev.tkirch.wsc.faq.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/acp/database/install_dev.tkirch.wsc.faq.php b/files/acp/database/install_dev.tkirch.wsc.faq.php index 1bed0b0..1eb7dde 100644 --- a/files/acp/database/install_dev.tkirch.wsc.faq.php +++ b/files/acp/database/install_dev.tkirch.wsc.faq.php @@ -7,6 +7,7 @@ use wcf\system\database\table\column\TinyintDatabaseTableColumn; use wcf\system\database\table\DatabaseTable; use wcf\system\database\table\index\DatabaseTableForeignKey; +use wcf\system\database\table\index\DatabaseTablePrimaryIndex; return [ DatabaseTable::create('wcf1_faq_questions') @@ -25,6 +26,10 @@ ->notNull() ->defaultValue(0), ]) + ->indices([ + DatabaseTablePrimaryIndex::create() + ->columns(['questionID']), + ]) ->foreignKeys([ DatabaseTableForeignKey::create() ->columns(['categoryID']) From a943452bb7d5d9b0e388a32e225553b0e2e4f3fc Mon Sep 17 00:00:00 2001 From: Peter Lohse Date: Thu, 19 Oct 2023 17:17:39 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Install-Script=20statt=20Update-Script=20au?= =?UTF-8?q?sf=C3=BChren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update_dev.tkirch.wsc.faq_2.0.0_step1.php | 13 ------------- ...tep2.php => update_dev.tkirch.wsc.faq_2.0.0.php} | 0 package.xml | 4 ++-- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 files/acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php rename files/acp/{update_dev.tkirch.wsc.faq_2.0.0_step2.php => update_dev.tkirch.wsc.faq_2.0.0.php} (100%) diff --git a/files/acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php b/files/acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php deleted file mode 100644 index 0cccdc6..0000000 --- a/files/acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php +++ /dev/null @@ -1,13 +0,0 @@ -columns([ - TinyintDatabaseTableColumn::create('isMultilingual') - ->notNull() - ->defaultValue(0), - ]), -]; diff --git a/files/acp/update_dev.tkirch.wsc.faq_2.0.0_step2.php b/files/acp/update_dev.tkirch.wsc.faq_2.0.0.php similarity index 100% rename from files/acp/update_dev.tkirch.wsc.faq_2.0.0_step2.php rename to files/acp/update_dev.tkirch.wsc.faq_2.0.0.php diff --git a/package.xml b/package.xml index e7d7c2d..3c4387d 100644 --- a/package.xml +++ b/package.xml @@ -41,7 +41,7 @@ - acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php - acp/database/update_dev.tkirch.wsc.faq_2.0.0_step2.php + acp/database/install_dev.tkirch.wsc.faq.php + acp/database/update_dev.tkirch.wsc.faq_2.0.0.php From f67530e26c41a10b71655f4af633375f64abe3cb Mon Sep 17 00:00:00 2001 From: Peter Lohse Date: Thu, 19 Oct 2023 17:19:24 +0200 Subject: [PATCH 3/4] nicht lokalisierter Text --- language/de.xml | 1 + language/en.xml | 1 + templates/faqBBCode.tpl | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/language/de.xml b/language/de.xml index 9d289ad..a411e00 100644 --- a/language/de.xml +++ b/language/de.xml @@ -56,6 +56,7 @@ + diff --git a/language/en.xml b/language/en.xml index ad3c5a5..ef164de 100644 --- a/language/en.xml +++ b/language/en.xml @@ -56,6 +56,7 @@ + diff --git a/templates/faqBBCode.tpl b/templates/faqBBCode.tpl index e239979..6eeaa98 100644 --- a/templates/faqBBCode.tpl +++ b/templates/faqBBCode.tpl @@ -8,7 +8,7 @@
- FAQ: {$question->getTitle()} + {lang}wcf.faq.bbcode.title{/lang} {$question->getTitle()}
From ec7c17a72b562097e6c2b59e66b60de18a5cf089 Mon Sep 17 00:00:00 2001 From: Peter Lohse Date: Thu, 19 Oct 2023 17:23:01 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Suche=20in=20Action-Klasse=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/lib/action/FaqSearchAction.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/lib/action/FaqSearchAction.class.php b/files/lib/action/FaqSearchAction.class.php index adad89d..32857e3 100644 --- a/files/lib/action/FaqSearchAction.class.php +++ b/files/lib/action/FaqSearchAction.class.php @@ -15,17 +15,18 @@ class FaqSearchAction implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - if ($request->getMethod() === 'GET') { - return new HtmlResponse(WCF::getTPL()->fetch('faqQuestionSearchDialog')); - } elseif ($request->getMethod() === 'POST') { + if ($request->getMethod() === 'GET' || $request->getMethod() === 'POST') { $postParameters = Helper::mapQueryParameters( $request->getParsedBody(), <<<'EOT' array { - searchString: string + searchString?: string } EOT ); + if (!isset($postParameters['searchString'])) { + return new HtmlResponse(WCF::getTPL()->fetch('faqQuestionSearchDialog')); + } $sql = " SELECT faq_questions.questionID