All,
Just got these errors form searching, see attachment.
This is only my test site.
Quoteroot
Today at 08:40 AM
::1
21df2fd2ce1a15c953236c76c59e42e7
Type of error: Undefined
8: Undefined variable: approve_query
http://localhost/son/index.php?action=search2
D:/xampp/htdocs/son/Sources/Search.php (Line 1715)
What commit on GitHub?
https://github.com/SimpleMachines/SMF2.1
Yes, but when did you download it? It matters.
today 2 hours ago.
Did you install the "release" download from Github or did you install from the git HEAD files?
Oh wait... This is the current HEAD I think, I saw those too in my installations. They only happen sporadically, once after update and once or twice during mod install/uninstall. (Edit: And for every forum search, quite expectedly.)
Yup, seeing this line and line 1828. (GH version of ~2019-10-10.)
Quote from: m4z on November 27, 2019, 05:15:52 AM
Did you install the "release" download from Github or did you install from the git HEAD files?
I downloaded the "release" file from Github
Ah, because that file is actually the same as the rc2 in the download section here on sm.org, from way back (2019-03-30 or so).
Quote from: m4z on November 27, 2019, 05:27:52 AM
Ah, because that file is actually the same as the rc2 in the download section here on sm.org, from way back (2019-03-30 or so).
No, not the same
// *** Retrieve the results to be shown on the page
$participants = array();
$request = $smcFunc['db_search_query']('', '
SELECT ' . (empty($search_params['topic']) ? 'lsr.id_topic' : $search_params['topic'] . ' AS id_topic') . ', lsr.id_msg, lsr.relevance, lsr.num_matches
FROM {db_prefix}log_search_results AS lsr' . ($search_params['sort'] == 'num_replies' ? '
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = lsr.id_topic)' : '') . '
WHERE lsr.id_search = {int:id_search}
ORDER BY {raw:sort} {raw:sort_dir}
LIMIT {int:start}, {int:max}',
array(
'id_search' => $_SESSION['search_cache']['id_search'],
'sort' => $search_params['sort'],
'sort_dir' => $search_params['sort_dir'],
'start' => $_REQUEST['start'],
'max' => $modSettings['search_results_per_page'],
)
);
// *** Retrieve the results to be shown on the page
$participants = array();
$request = $smcFunc['db_search_query']('', '
SELECT ' . (empty($search_params['topic']) ? 'lsr.id_topic' : $search_params['topic'] . ' AS id_topic') . ', lsr.id_msg, lsr.relevance, lsr.num_matches
FROM {db_prefix}log_search_results AS lsr' . ($search_params['sort'] == 'num_replies' || !empty($approve_query) ? '
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = lsr.id_topic)' : '') . '
WHERE lsr.id_search = {int:id_search}' . $approve_query . '
ORDER BY {raw:sort} {raw:sort_dir}
LIMIT {int:start}, {int:max}',
array(
'id_search' => $_SESSION['search_cache']['id_search'],
'sort' => $search_params['sort'],
'sort_dir' => $search_params['sort_dir'],
'start' => $_REQUEST['start'],
'max' => $modSettings['search_results_per_page'],
'is_approved' => 1,
'current_member' => $user_info['id'],
'approve_boards' => !empty($approve_boards) ? $approve_boards : array(0),
)
);
Did you use the "releases" tab or the green "clone or download" button -> "download zip"?
I've been using smf for years how to install? I know the purpose of opening this thread is to report an error?
Yes, we heard you, the error will be "logged" on Github and will be fixed. (Thanks!)
I'm just trying to understand how you ended up in the situation you are in. Because if you did download the actual rc2 release file, you shouldn't see this problem, it was introduced later on. This is why I'm trying to find out what happened.
same mistake.
Type of error: Undefined
8: Undefined variable: approve_query
http://localhost:8080/smf/index.php?action=search2
C:/wamp64/www/smf/Sources/Search.php (Line 1828)
Type of error: Undefined
8: Undefined variable: approve_query
http://localhost:8080/smf/index.php?action=search2
C:/wamp64/www/smf/Sources/Search.php (Line 1715)
Quote from: gecitli on November 27, 2019, 07:19:06 AM
I've been using smf for years how to install? I know the purpose of opening this thread is to report an error?
Yes, but depending on when you got it from GitHub and how, it can affect us fixing the bug, that's why we ask these questions.
That's why I asked for the commit, as that tells us *exactly* which code you're looking at. Because what's on GitHub up to multiple times a day...
As always use the nightly download would be the easy way...
I now reported this as GH#5877 (https://github.com/SimpleMachines/SMF2.1/issues/5877).