
Originally Posted by
Carbonless
I installed on a test server. Displays the initial note on the admin page, but delivered an error log:
Code:
[15-Jan-2021 16:47:17 America/Chicago] Request URI: /XXXX/index.php?cmd=notes&nID=1, IP address: XXXX
#1 zen_get_notes_categories_array() called at [/XXXX/notes.php:193]
#2 require(/XXXX/notes.php) called at [/XXXX/index.php:11]
--> PHP Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /XXXX/notes.php on line 183.
i've never used it. in a cursory look, it could use a complete refactor. i'm guessing this is just one of many sort of errors in the code. last updated almost 4 years ago.
for your specific error, you can try replacing the appropriate section as follows:
PHP Code:
function zen_get_notes_categories_array($all = false){
global $db;
$categories = $db->Execute("SELECT * FROM " . TABLE_NOTES_CATEGORIES . " ORDER BY notes_categories_name");
if($all == true){
$categories_array[] = ['id' => 0, 'text' => 'All'];
}
while(!$categories->EOF){
$categories_array[] = ['id'=> $categories->fields['notes_categories_id'], 'text' => $categories->fields['notes_categories_name']];
$categories->MoveNext();
}
return $categories_array;
}
best.