Currently running build 7375, I now find that using the Research Assistant in a number of cases generates a series of errors. I have dozens of tasks, though they were all created before php 8 was introduced so I don't know if this may be a contributing factor. For instance I find that I now receive a fatal error when I add new items to my existing task list then I hit save. I receive the error:
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /volume1/web/phpgedview/includes/classes/class_pgv_db.php on line 852 PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /volume1/web/phpgedview/includes/classes/class_pgv_db.php on line 852 Call Stack: 0.0001 367680 1. {main}() /volume1/web/phpgedview/module.php:0 0.0099 753776 2. research_assistant->main() /volume1/web/phpgedview/module.php:126 0.0527 838072 3. ra_functions->print_folder_view($folderId = '1', $orderby = ???) /volume1/web/phpgedview/modules/research_assistant/research_assistant.php:164 0.0527 838072 4. ra_functions->get_subfolders($parentId = '1', $orderby = '') /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:653 0.0527 838944 5. PGV_DBStatement->execute([0 => '1']) /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:596 0.0527 839160 6. PGV_DBStatement->call($function = 'execute', $params = [0 => [0 => '1']]) /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:596 0.0527 839160 7. PDOStatement->execute($params = [0 => '1']) /volume1/web/phpgedview/includes/classes/class_pgv_db.php:852
To clarify, even though it generates the fatal error if I look into the task list it looks like it added an entry. If I try to delete an existing item I receive the error:
ERROR 2: Undefined array key "folder"
0 Error occurred on line 230 of file research_assistant.php in function main
1 called from line 126 of file module.php
Warning: Undefined array key "folder" in /volume1/web/phpgedview/modules/research_assistant/research_assistant.php on line 230 Call Stack: 0.0001 379328 1. {main}() /volume1/web/phpgedview/module.php:0 0.0636 10287000 2. research_assistant->main() /volume1/web/phpgedview/module.php:126
ERROR 2: Undefined array key "folder"
0 Error occurred on line 231 of file research_assistant.php in function main
1 called from line 126 of file module.php
Warning: Undefined array key "folder" in /volume1/web/phpgedview/modules/research_assistant/research_assistant.php on line 231 Call Stack: 0.0001 379328 1. {main}() /volume1/web/phpgedview/module.php:0 0.0636 10287000 2. research_assistant->main() /volume1/web/phpgedview/module.php:126
Even though I received this error and it brings me back to the task folder level screen rather than the updated task view I would expect. Returning to my task view the task I tried to delete now appears to be gone from the tasks. If from this task folder level (by going into "View Folders") I receive this error:
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /volume1/web/phpgedview/includes/classes/class_pgv_db.php on line 852 PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /volume1/web/phpgedview/includes/classes/class_pgv_db.php on line 852 Call Stack: 0.0000 379344 1. {main}() /volume1/web/phpgedview/module.php:0 0.0640 10291112 2. research_assistant->main() /volume1/web/phpgedview/module.php:126 0.0938 10374088 3. ra_functions->print_folder_view($folderId = '1', $orderby = ???) /volume1/web/phpgedview/modules/research_assistant/research_assistant.php:95 0.0938 10374088 4. ra_functions->get_subfolders($parentId = '1', $orderby = '') /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:653 0.0939 10374960 5. PGV_DBStatement->execute([0 => '1']) /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:596 0.0939 10375176 6. PGV_DBStatement->call($function = 'execute', $params = [0 => [0 => '1']]) /volume1/web/phpgedview/modules/research_assistant/ra_functions.php:596 0.0939 10375176 7. PDOStatement->execute($params = [0 => '1']) /volume1/web/phpgedview/includes/classes/class_pgv_db.php:852
Good luck. I can't help you; I don't use the Research Assistant.
The Research Assistant module isn't supported, and hasn't been updated in a very long time, except to correct some syntax errors caused by "improvements" to PHP (PHP 7.x and PHP 8.x)
I think the problem may be caused by your browser eating the "folder" input variable.
Lines 230 and 231 of the script research_assistant.php are looking for an input variable called "folder", and that variable is missing from the URL that launches the Research Assistant. That input variable is used in many different locations throughout the RA code.
You could try going through the Research Assistant code and changing the input variable to something other than "folder". "folder_name" would probably work, and would not impact the quality of the code.
I'm not going to do this. I don't use the RA module; I know nothing about it.
Hi Gerry,
I found the problem and this took me on a whole rathole investigation as it seems that there were many outstanding bugs in the code, duplications in functionality in multiple places as well as multiple places that weren't compatible with php 8. I am in the late stages of testing it all after now touching and updating every file related to the Research Assistant.
When I am done I can send it back to update the server so anyone who used it in the past can continue using it.
Thank you, Douglas.
I do not use the Research Assistant. It was a student project at Neumont University, under the guidance of John Finlay, quite a few years ago. As with most student projects that I have encountered, there are bound to be lots of coding errors and other unsanitary things.
Please send me the updated scripts when you're done. Do NOT send diff files, please. They don't work very well in my environment.
I have today posted a large set of updates to PGV. They have nothing to do with the Research Assistant. E-mail me directly at gkroll (at) keldine (dot) ca for instructions on where to download a zip file so that you don't have to get a copy of the entire set of SVN files. I do NOT want to post these instructions here.
Hi Gerry,
I have finished the update to all the Research Assistant files to make it usable. I will send you an email now with details on where to pick it up, what has changed and what I am looking to continue to do with it going forward for RA fixes/develpment. Note some of the changes could help Tomasz with his js updates, so I will let you work that with him.
Terry,
I don't like the code of RA so if you changed it to something more
readable, you are welcome. But try to remove as much as possible
strange/abandoned/deprecated libraries turning them into up to date
jQuery with jQuery UI. Yes, I know, jQuery is also not the rocket
science but it is relatively small and handy in use.
T.B.
Fixed in SVN 7377.
Complete replacement of the Research Assistant module, but with somewhat limited functionality.
Thank you, Douglas Terry.