Closed milenh closed 7 years ago
Can you provide some more information? Any error/warning/notice messages emitted by "ui.php"?
There are no error messages. Is there a way I can enable a more deep debug level? What I did is really straightforward - just copied api.php and ui.php in the same dir (along with all github files they have). Edited the bottoms of files, so I can connect to my localhost DB and get the json to ui.php from api.php. All file permissions are 755, so it should be ok.
The url which I'm using to get the data into ui.php is using filler, but I get the same result without filter too. The url looks like this: http://localhost/php-crud-api/api.php/trucks?filter=client_id,eq,14
Ok, so I enabled error reporting and this is what comes out:
Warning: array_filter() expects parameter 1 to be array, boolean given in /var/www/html/php-crud-api/ui.php on line 116
Warning: array_map(): Argument #2 should be an array in /var/www/html/php-crud-api/ui.php on line 122
Warning: array_filter() expects parameter 1 to be array, null given in /var/www/html/php-crud-api/ui.php on line 122
Warning: implode(): Invalid arguments passed in /var/www/html/php-crud-api/ui.php on line 122
Also when I click on Edit a record, this one comes out:
Notice: Array to string conversion in /var/www/html/php-crud-api/ui.php on line 269
Thank you, that helps to analyze the problem.
btw, the css urls are missing "http(s)", so you might want to correct it :)
btw, the css urls are missing "http(s)", so you might want to correct it :)
Those are protocol relative urls. See: https://www.paulirish.com/2010/the-protocol-relative-url/
There recently was a bug introduced in a wrong merge. Can you update "ui.php" with the latest version and let me know whether or not that fixed the issue?
see: https://github.com/mevdschee/php-crud-ui/pull/20/commits/1f3b7c1f139b2f32412d591c718fe0876d52e905
NB: search for '$this->$properties' and replace with '$this->properties'.
I'm using already the latest version and the the line is already "$this->properties". The errors are still there.
This issue (or maybe only some of the listed errors) occurs 'cause currently no swagger information are provided as definition
from the api.php
. Therefore the left column and list of available tables is empty as shown in the screenshots.
Due to the missing defintion, no properties can be loaded. At least the two methods references
and referenced
return the boolen value false
. The array methods around line 116/122 expect an empty array instead of the boolean. The php error from milenh already mentions that behavior.
Warning: array_filter() expects parameter 1 to be array, boolean given in /var/www/html/php-crud-api/ui.php on line 116
I've already described that issue in my pull request php-crud-api#208.
Following @appcrew bug report for api.php, I confirm updating the api.php (and ui.php) to the latest versions solved the problem.
Thank you for your feedback!
Passing the url to api.php retrieves json object ok:
I can see the $parameters variable populated with the database query correctly, but for some reason the content is not displayed in the table. I can't see the list:
If I manually type selector/list, I got it partially working:
However, trying to add or edit a record doesn't work.