Voyager: Error creating new menu item in new and existing menus

Created on 2 Mar 2017  路  7Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.3.30
  • Voyager Version: 0.10.16
  • PHP Version: 7.0.15
  • Database Driver & Version: mysql 5.7.17

Description:

After deploying my laravel app, I get the following 3 errors when I try to add a new menu item to a newly create menu:

1/3
PDOException in PDOConnection.php line 77: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'query_string' in 'field list'

2/3
PDOException in PDOConnection.php line 79: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'query_string' in 'field list'

3/3
QueryException in Connection.php line 770: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'query_string' in 'field list' (SQL: insert intomenu_items(title,url,icon_class,color,target,menu_id,query_string,order,updated_at,created_at) values (Blog, /blog, pencil, #000000, _self, 2, , 13, 2017-03-02 05:46:55, 2017-03-02 05:46:55))

This also happens with the menu that comes with voyager. The only difference is the data in the query.

The problem doesn't happen when I run it on my laptop, which runs on mariadb.

Steps To Reproduce:

  1. Log in to Voyager
  2. Tools -> Menu Builder
  3. In one of the menus, click in "Builder"
  4. Click on "New Menu Item"
  5. Fill the form with the menu data and then click "Add New Item"
  6. Error comes up
help wanted possible bug

Most helpful comment

I've got the same exception. My setup is a custom docker-compose with nginx and mariadb. You should check your specific nginx config file if you have set the $-sign of the query_string variable. In my case I just forgot it.

location / { try_files $uri $uri/ /index.php?$query_string; }

All 7 comments

do you have the solutions yet?

Please update your version of Voyager to 0.11.* (I believe 0.11.4 is the current release). Also, please either re-run the migrations (specifically 2016_05_19_173453_create_menu_table.php) or manually delete the query_string field from the menu_items table.

I checked my database both in voyager and in mysql with DESCRIBE menu_items after selecting the right database and my table does not have a field called query_string.

Also, I believe I broke my local voyager installation. I couldn't find any update instructions anywhere. Besides adding 0.11.* to my composer.json, what else do I have to do?

To upgrade update to use "tcg/voyager": "0.11.*" and run composer update.
Then please remake your config/voyager.php (with our latest default) and go through our database migrations and ensure that all minor changes are in your database.

If you have any problems upgrading, please let me know.
Also if the issue still applies after upgraded, then please also let me know.

I've got the same exception. My setup is a custom docker-compose with nginx and mariadb. You should check your specific nginx config file if you have set the $-sign of the query_string variable. In my case I just forgot it.

location / { try_files $uri $uri/ /index.php?$query_string; }

@plugware your fix worked for me.
Thanks.

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IvanBohonosiuk picture IvanBohonosiuk  路  4Comments

Nagendra1421 picture Nagendra1421  路  3Comments

rayqiri picture rayqiri  路  3Comments

abacram picture abacram  路  3Comments

raoasifraza1 picture raoasifraza1  路  3Comments