Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite required #7

Open
Mte90 opened this issue Oct 5, 2022 · 7 comments
Open

Rewrite required #7

Mte90 opened this issue Oct 5, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Mte90
Copy link

Mte90 commented Oct 5, 2022

Looking at what is printed the urls in the admin ui:

<li><a href="{{base}}/admin/table/list">home</a></li>

But the readme doesn't mention that is required a URL rewriting for the file and that will ignore the folder where the project is.

Example:

http://localhost/php-crud-admin/admin.php/table/list

Generate:

error
code:

1000
message:

Route '/table/list' not found

But http://localhost/php-crud-admin/admin.php/ I get the list of tables but the links are http://localhost/admin/column/mytable/list.

@mevdschee
Copy link
Owner

A rewrite should not be needed. The {base} is not correctly detected.

@mevdschee mevdschee self-assigned this Oct 6, 2022
@mevdschee mevdschee added the bug Something isn't working label Oct 6, 2022
@mevdschee
Copy link
Owner

@Mte90 Can you tell me the webserver you are using? Is it Apache, PHP internal server or Nginx?

@mevdschee
Copy link
Owner

For PHP's internal server I added a file start.sh containing a command to start the application:

php -S localhost:8000 admin.php

I hope this helps.

@Mte90
Copy link
Author

Mte90 commented Oct 6, 2022

On apache :-)

I saw that bash script few minutes ago :-)

@mevdschee
Copy link
Owner

Thank you. I'll test the {base} detection on Apache and get back to you

@mevdschee
Copy link
Owner

It is fixed in v2.0.2. Does it work for you?

@Mte90
Copy link
Author

Mte90 commented Oct 7, 2022

[Fri Oct 07 14:39:05.575271 2022] [proxy_fcgi:error] [pid 81210] [client 127.0.0.1:53206] AH01071: Got error 'PHP message: PHP Warning: Undefined array key "tables" in /home/www/php-crud-admin/admin.php on line 13121PHP message: PHP Fatal error: Uncaught TypeError: Tqdev\\PhpCrudAdmin\\Column\\DefinitionService::makeNamed(): Argument #1 ($array) must be of type array, null given, called in /home/www/php-crud-admin/admin.php on line 13121 and defined in /home/www/php-crud-admin/admin.php:13128\nStack trace:\n#0 /home/www/php-crud-admin/admin.php(13121): Tqdev\\PhpCrudAdmin\\Column\\DefinitionService->makeNamed()\n#1 /home/www/php-crud-admin/admin.php(13087): Tqdev\\PhpCrudAdmin\\Column\\DefinitionService->optimizeDatabase()\n#2 /home/www/php-crud-admin/admin.php(14036): Tqdev\\PhpCrudAdmin\\Column\\DefinitionService->__construct()\n#3 /home/www/php-crud-admin/admin.php(14212): Tqdev\\PhpCrudAdmin\\Admin->__construct()\n#4 {main}\n thrown in /home/www/php-crud-admin/admin.php on line 13128'

I get this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants