Closed Soliaonline closed 1 year ago
This issue probably needs to be moved to the Help_bar with more information so we can help you better.
I meant the actual URL in the browser eg. http://localhost/app/items-categories/1
Regardless, I think I can see your problem - in the manage() method
$all_rows = $this->model->get('id');
You have to help the framework with a table name because you are in a sub-module, try:
$all_rows = $this->model->get('id', 'categories');
I have also spotted a minor framework fix in Trongate.php
protected ?string $module_name = '';
This will fix an error when trying to open a normal view from a sub-module, yours will be OK as you are opening a view from a template.
Is this resolved?
I reckon it is - but wait a bit for @Soliaonline to respond...
I feel like in the video it did not do $this->model->get('id', 'categories'), I could be wrong and that's fine. If the fix is to tell trongate where you are, that's fine too. Maybe in the future, if blank check for parent/child module
My final question, is how do I get the API explorer to work then?
https://192.168.0.175/api/explorer/categories => 2 Errors
Warning: foreach() argument must be of type array|object, null given in C:\xampp\webdav\soliaonline\engine\views\api_explorer.php on line 43
Warning: file_get_contents(C:/xampp/webdav/soliaonline/modules/categories/assets/api.json): Failed to open stream: No such file or directory in C:\xampp\webdav\soliaonline\engine\Api.php on line 72
https://192.168.0.175/api/explorer/items-categories => No table
The table is currently blank, so if that is correct, then that needs to be caught with an if statement as well.
PS: can we please get an icon list in the documentation? I know it's basically FA 4, but just want to know what I can and cannot use without opening the trongate app and faking a new creation.
Life: The basics:
1). Assume that the universe owes you nothing.
2). When somebody helps you to solve a problem, THANK THEM.
3). After you've received help, try to make the other person's life BETTER for having interacted with you.
Contemplate this on the Tree of Woe.
I am afraid I do not understand. Do I not have a valid sub module issue? The API isn't working, is it not suppose to if it is a sub module?
@trongate If you would please let me know, I would appreciate it.
Built the Module with the Trongate app version 1.0.004.
Created categories database that looks like.
https://i.imgur.com/ETqnYi1.png
I have parent::__construct(); however the Trongate class still does not know to call the categories database. Model.php $this->get_table_from_url() is returning blank.
Thank you for taking a look at it. If I have done something wrong I apologize, I did take the time and watch https://trongate.io/docs/information/complete-video-tutorial video before posting. It says that parent::__construct() is suppose to resolve this exact issue, and I had it there the entire time, I do not know if the new update broke this, or if I am missing something.