GrafiteInc / CMS

Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.
https://cms.grafite.ca
MIT License
494 stars 104 forks source link

Can not create Page, Blog, Menu etc. #188

Open RushabhJoshi opened 5 years ago

RushabhJoshi commented 5 years ago

Describe the bug I have tested it on fresh installation. When you create a page, blog etc same error occurs seems like model fillable not working as expected

Illuminate\Database\QueryException thrown with message "SQLSTATE[42S22]: Column not found: 1054 Unknown column '_url' in 'field list' (SQL: insert into pages (title, url, entry, seo_description, seo_keywords, is_published, published_at, _url, blocks, updated_at, created_at) values (About, about, , , , 1, 2018-12-12 12:53:58, /cms/pages, {}, 2018-12-12 12:53:58, 2018-12-12 12:53:58))"

Stacktrace:

78 Illuminate\Database\QueryException in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664

77 Doctrine\DBAL\Driver\PDOException in /home/rushabh/localhost/blog/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:63

76 PDOException in /home/rushabh/localhost/blog/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:61

75 PDO:prepare in /home/rushabh/localhost/blog/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:61

74 Doctrine\DBAL\Driver\PDOConnection:prepare in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:452

73 Illuminate\Database\Connection:Illuminate\Database{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657

72 Illuminate\Database\Connection:runQueryCallback in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624

71 Illuminate\Database\Connection:run in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:459

70 Illuminate\Database\Connection:statement in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:411

69 Illuminate\Database\Connection:insert in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32

68 Illuminate\Database\Query\Processors\Processor:processInsertGetId in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2595

67 Illuminate\Database\Query\Builder:insertGetId in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1318

66 Illuminate\Database\Eloquent\Builder:__call in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:823

65 Illuminate\Database\Eloquent\Model:insertAndSetId in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:788

64 Illuminate\Database\Eloquent\Model:performInsert in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:651

63 Illuminate\Database\Eloquent\Model:save in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:790

62 Illuminate\Database\Eloquent\Builder:Illuminate\Database\Eloquent{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Support/helpers.php:1027

61 tap in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:791

60 Illuminate\Database\Eloquent\Builder:create in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23

59 Illuminate\Database\Eloquent\Model:forwardCallTo in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1608

58 Illuminate\Database\Eloquent\Model:__call in /home/rushabh/localhost/blog/vendor/grafite/cms/src/Repositories/PageRepository.php:49

57 Grafite\Cms\Repositories\PageRepository:store in /home/rushabh/localhost/blog/vendor/grafite/cms/src/Controllers/PagesController.php:76

56 Grafite\Cms\Controllers\PagesController:store in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

55 call_user_func_array in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

54 Illuminate\Routing\Controller:callAction in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45

53 Illuminate\Routing\ControllerDispatcher:dispatch in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Route.php:212

52 Illuminate\Routing\Route:runController in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Route.php:169

51 Illuminate\Routing\Route:run in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php:682

50 Illuminate\Routing\Router:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

49 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/app/Http/Middleware/GrafiteCms.php:21

48 App\Http\Middleware\GrafiteCms:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

47 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

46 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41

45 Illuminate\Routing\Middleware\SubstituteBindings:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

44 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

43 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:43

42 Illuminate\Auth\Middleware\Authenticate:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

41 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

40 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:75

39 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

38 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

37 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49

36 Illuminate\View\Middleware\ShareErrorsFromSession:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

35 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

34 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:63

33 Illuminate\Session\Middleware\StartSession:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

32 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

31 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37

30 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

29 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

28 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66

27 Illuminate\Cookie\Middleware\EncryptCookies:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

26 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

25 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

24 Illuminate\Pipeline\Pipeline:then in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php:684

23 Illuminate\Routing\Router:runRouteWithinStack in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php:659

22 Illuminate\Routing\Router:runRoute in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php:625

21 Illuminate\Routing\Router:dispatchToRoute in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php:614

20 Illuminate\Routing\Router:dispatch in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176

19 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

18 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/fideloper/proxy/src/TrustProxies.php:57

17 Fideloper\Proxy\TrustProxies:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

16 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

15 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31

14 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

12 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31

11 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

10 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

9 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27

8 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

6 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62

5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

3 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

2 Illuminate\Pipeline\Pipeline:then in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151

1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /home/rushabh/localhost/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116

0 Illuminate\Foundation\Http\Kernel:handle in /home/rushabh/localhost/blog/public/index.php:55

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Pages '
  2. Click on 'Add New'
  3. Fillup the form with appropriate values
  4. Click on 'Save'

Expected behavior It should save correctly and redirect to edit page

Screenshots https://screenshots.firefox.com/0DguSIaZEPqnu9T2/blog.laravel.local

Desktop (please complete the following information):

mlantz commented 5 years ago

What do you mean by Model fillable as expected? I've tested with a fresh application and I cannot replicate this issue.

RushabhJoshi commented 5 years ago

I have attached screenshot and added error log

seems like every time it is trying to add '_url' in a table where '_url' is Larave default request attribute I have checked the model and did not find '_url' in fillable.

I manually unset the '_url' in a repository and it worked fine

karjogedhe commented 5 years ago

Hi @mlantz ,

I have the same kind of this issue. the QueryException has thrown :
SQLSTATE[42S22]: Column not found: 1054 Unknown column '/administrator/blog' in 'field list' (SQL: insert into blogs (title, url, tags, entry, excerpt, seo_description, seo_keywords, published_at, /administrator/blog, blocks, is_published, updated_at, created_at) values (Test assets, test-assets, , , , , , 2019-02-06 05:49:49, , {}, 0, 2019-02-06 05:49:49, 2019-02-06 05:49:49))

which is, the unknown column is represent the form action's target URL.

I have two server engines. it work on NGINX but not Apache2..

Please suggest, thanks!