Page 1 of 2

Links at views going to root

Posted: 17 Sep 2016, 08:18
by daniel.groppo
Hello,

I'm beginner with Aimeos at Laravel 5.2. I have followed every step of installation documentation (including auth steps for Laravel 5.2). I already searched in many communities about my problem, but I'm no finding anything.

I'm using XAMPP with PHP 5.6 and my application is located at C:/xamp/htdocs/myapp/ - I modified the .env file to recognize the myapp folder (APP_URL=http://localhost/myapp). When I execute Request::root() its returns localhost/myapp/public (ok!).

When I type the address in the browser, it works perfectly (Example: localhost/myapp/public/list). But my problems are the Aimeos links. Example: when I click in one product item, it opens http://localhost/detail/1/Demo_article/0. The same occurs when I click anything else, like Basket (http://localhost/basket).

Am I doing anything wrong?

Re: Links at views going to root

Posted: 17 Sep 2016, 09:30
by aimeos
Laravel requires your ./public/ directory to be the document root so http://localhost/ will return the Laravel welcome page. Then, the Aimeos links will work as expected.

Re: Links at views going to root

Posted: 17 Sep 2016, 16:10
by daniel.groppo
Thanks for your reply, but is it possible to use Aimeos inside a subdirectory like 'myapp'? Its because I have many others Laravel applications inside the localhost (even these apps works well with subdirectory), and in the future I want to create others Aimeos app in my local server.

Re: Links at views going to root

Posted: 17 Sep 2016, 17:24
by aimeos
That's a good question. Aimeos doesn't make any assumptions about the URLs and leaves everything to the Laravel router. If you can convince the Laravel router to generate URLs which includes the subdirectories, it will work. Then you only have to adapt the directories for the Aimeos content in the config file.

You should be aware that there may be security problems if you store your Laravel application in a subdirectory because e.g. the log and session files are then available in public.

Re: Links at views going to root

Posted: 17 Sep 2016, 18:46
by daniel.groppo
Thank you again for your reply. I did not know about these security problems. I created a virtual host in my local environment and my problem was partially solved.

Now I can acess http://myapp/list and all the links are working. But when I login (http://myapp/admin), I'm redirected to http://myapp/jqadm/search/dashboard, and the following exception is displayed:

Code: Select all

HttpException in Handler.php line 107:
This action is unauthorized.
And when I type http://myappp/jqadm or http://myapp/extadm, the following exception is displayed:

Code: Select all

NotFoundHttpException in RouteCollection.php line 161:
I thought that these errors were due to the previously reported problem, but have not been resolved. Am I doing anything wrong again?

Re: Links at views going to root

Posted: 17 Sep 2016, 20:23
by aimeos
Did you create the user account with

Code: Select all

./artisan aimeos:account --admin you@example.com
If you only register users, they don't have access to the admin interface.

Re: Links at views going to root

Posted: 17 Sep 2016, 21:23
by daniel.groppo
Yes, I executed the command, but I had the same problem of bruno: https://github.com/aimeos/aimeos-laravel/issues/62

The connection with database is working. I did the installation from the scratch again. I executed the following commands (without any error), but the mshop_customer_list_type have no records (others tables like products are ok).

Code: Select all

php artisan vendor:publish
 php artisan migrate
php artisan aimeos:setup --option=setup/default/demo:1
 php artisan aimeos:cache
 php artisan cache:clear
And when I run the command that you mentioned, the register is created at users table and it returns:

Code: Select all

[Aimeos\MShop\Exception]                            
  No item found for conditions: Array                 
  (                                                   
      [customer.lists.type.code] => default           
      [customer.lists.type.domain] => customer/group  
  )
How can I get around this?

Thank you for your patient, it is the first time I do it alone.

Re: Links at views going to root

Posted: 18 Sep 2016, 08:39
by aimeos
You've said the "mshop_customer_list_type" table is empty. What about the "users_list_type"?

Re: Links at views going to root

Posted: 18 Sep 2016, 19:18
by daniel.groppo
Yes, there are 5 registers in users_list_types.

Re: Links at views going to root

Posted: 19 Sep 2016, 08:03
by aimeos
There should be six. I guess, the one with domain='customer/group' is missing?