-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for search warnings, errors and addressing issue 114 #116
Conversation
Is there a trick to not have that composer thing ruin things for me? I is there a way to only have it process the files I changed? Because I change a few files and then it goes through and hits 30 or so more files. Kinda frustrating :) |
04626b4
to
a42bb4d
Compare
I think I just fixed it. Go ahead and update your master for any future PRs so that the change carries over to your local computer. |
src/forum/search.php
Outdated
if (!$boardObj->select($value) && $value != 0) { | ||
$countErrors++; | ||
if (isset($_POST['filterboards']) && is_array($_POST['filterboards'])) { | ||
foreach ($_POST['filterboards'] as $value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can get rid of line 125 and for line 126 do foreach ($_POST['filterboards'] ?? [] as $value) {
. Should accomplish the same thing with less code :)
src/forum/search_results.php
Outdated
@@ -146,16 +146,18 @@ | |||
|
|||
// Filter Board | |||
$arrFilterBoards = array(); | |||
if (!in_array(0, $_POST['filterboards'])) { | |||
$arrFilterBoards = $_POST['filterboards']; | |||
$filterBoards = $_POST['filterboards'] ?? []; // Use null coalescing operator to provide a default empty array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comment needed here. Since it is just saying the same thing as the code.
src/forum/search_results.php
Outdated
$boardObj->select($value); | ||
$arrFilterBoards = array_merge($arrFilterBoards, $boardObj->getAllSubForums()); | ||
} | ||
|
||
$arrFilterBoards = array_unique($arrFilterBoards); | ||
$arrFilterBoards = array_unique($arrFilterBoards); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should delete 1 tab to fix indenting
src/classes/form.php
Outdated
@@ -144,7 +144,8 @@ public function show() { | |||
case "autocomplete": | |||
$afterJS .= $this->autocompleteJS($componentInfo['options']['list'], $componentInfo['options']['real_id'], $componentInfo['options']['fake_id']); | |||
$fakeComponentName = "fake".$componentName; | |||
$displayForm .= "<input type='text' name='".$fakeComponentName."' value='".filterText($_POST[$fakeComponentName])."' ".$dispAttributes." id='".$componentInfo['options']['fake_id']."'><input type='hidden' name='".$componentName."' value='".($componentInfo['value'] ?? '')."' id='".$componentInfo['options']['real_id']."'>"; | |||
$fakeComponentValue = $_POST[$fakeComponentName] ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$_POST[$fakeComponentName]
is only used once, so I don't think we need the extra variable $fakeComponentValue
. Instead we can just do $_POST[$fakeComponentName] ?? ''
@@ -144,7 +144,8 @@ public function show() { | |||
case "autocomplete": | |||
$afterJS .= $this->autocompleteJS($componentInfo['options']['list'], $componentInfo['options']['real_id'], $componentInfo['options']['fake_id']); | |||
$fakeComponentName = "fake".$componentName; | |||
$displayForm .= "<input type='text' name='".$fakeComponentName."' value='".filterText($_POST[$fakeComponentName])."' ".$dispAttributes." id='".$componentInfo['options']['fake_id']."'><input type='hidden' name='".$componentName."' value='".($componentInfo['value'] ?? '')."' id='".$componentInfo['options']['real_id']."'>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it intentional to delete the hidden <input>
here?
…ressing-issue-114
…-114' of https://github.com/deepend-tildeclub/bluethrust5 into pr/deepend-tildeclub/116
This reverts commit 16383ee.
removed comment on line 146.
removed the "$fakeComponentValue" Line.
…ressing-issue-114
Didn't really absolutely need the issue 114 dealt with right now. But I was dealing with search stuff so I did it anyways.