Skip to content
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

deepend-tildeclub
Copy link
Contributor

Didn't really absolutely need the issue 114 dealt with right now. But I was dealing with search stuff so I did it anyways.

@deepend-tildeclub
Copy link
Contributor Author

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 :)

@RedDragonWebDesign RedDragonWebDesign force-pushed the fixes-for-search--warnings,-errors-and-addressing-issue-114 branch from 04626b4 to a42bb4d Compare January 26, 2024 09:09
@RedDragonWebDesign
Copy link
Owner

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.

if (!$boardObj->select($value) && $value != 0) {
$countErrors++;
if (isset($_POST['filterboards']) && is_array($_POST['filterboards'])) {
foreach ($_POST['filterboards'] as $value) {

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 :)

@@ -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

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.

$boardObj->select($value);
$arrFilterBoards = array_merge($arrFilterBoards, $boardObj->getAllSubForums());
}

$arrFilterBoards = array_unique($arrFilterBoards);
$arrFilterBoards = array_unique($arrFilterBoards);

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

@@ -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] ?? '';

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']."'>";

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?

@deepend-tildeclub deepend-tildeclub deleted the fixes-for-search--warnings,-errors-and-addressing-issue-114 branch January 27, 2024 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants