fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
488 stars 301 forks source link

Errors in adding collections #2430

Closed kexuebin closed 5 years ago

kexuebin commented 5 years ago

Error adding favorites

fisharebest commented 5 years ago

Error adding favorites

What error? (It works for me)

HTML module, add pictures, modify pictures error

What error? (It works for me)

PLEASE - create a separate issue for each problem.

kexuebin commented 5 years ago

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into wt_favorite (gedcom_id, user_id, xref, favorite_type, note) values (1, ?, X305, INDI, 123)) …/vendor/illuminate/database/Connection.php:664

0 …/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into `wt...', Array, Object(Closure))

1 …/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run('insert into `wt...', Array, Object(Closure))

2 …/vendor/illuminate/database/Connection.php(411): Illuminate\Database\Connection->statement('insert into `wt...', Array)

3 …/vendor/illuminate/database/Query/Builder.php(2640): Illuminate\Database\Connection->insert('insert into `wt...', Array)

4 …/vendor/illuminate/database/Query/Builder.php(2702): Illuminate\Database\Query\Builder->insert(Array)

5 …/app/Module/FamilyTreeFavoritesModule.php(272): Illuminate\Database\Query\Builder->updateOrInsert(Array, Array)

6 …/app/Module/FamilyTreeFavoritesModule.php(204): Fisharebest\Webtrees\Module\FamilyTreeFavoritesModule->addRecordFavorite(Object(Fisharebest\Webtrees\Tree), Object(Fisharebest\Webtrees\Individual), '123')

7 [internal function]: Fisharebest\Webtrees\Module\FamilyTreeFavoritesModule->postAddFavoriteAction(Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\Webtrees\Tree), Object(Fisharebest\Webtrees\User))

8 …/app/Application.php(45): ReflectionMethod->invoke(Object(Fisharebest\Webtrees\Module\FamilyTreeFavoritesModule), Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\Webtrees\Tree), Object(Fisharebest\Webtrees\User))

9 …/app/Http/RequestHandlers/ModuleAction.php(90): Fisharebest\Webtrees\Application->dispatch(Object(Fisharebest\Webtrees\Module\FamilyTreeFavoritesModule), 'postAddFavorite...')

10 …/app/Http/Middleware/RequestRouter.php(72): Fisharebest\Webtrees\Http\RequestHandlers\ModuleAction->handle(Object(Nyholm\Psr7\ServerRequest))

11 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RequestRouter->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

12 …/app/Module/HitCountFooterModule.php(141): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

13 …/app/Http/Middleware/ModuleMiddleware.php(70): Fisharebest\Webtrees\Module\HitCountFooterModule->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

14 …/app/Http/Middleware/ModuleMiddleware.php(75): class@anonymous->handle(Object(Nyholm\Psr7\ServerRequest))

15 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ModuleMiddleware->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

16 …/app/Http/Middleware/BootModules.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

17 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BootModules->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

18 …/app/Http/Middleware/UseTransaction.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

19 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTransaction->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

20 …/app/Http/Middleware/CheckCsrf.php(63): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

21 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckCsrf->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

22 …/app/Http/Middleware/DoHousekeeping.php(76): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

23 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\DoHousekeeping->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

24 …/app/Http/Middleware/UseTheme.php(70): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

25 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTheme->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

26 …/app/Http/Middleware/CheckForMaintenanceMode.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

27 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckForMaintenanceMode->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

28 …/app/Http/Middleware/UseLocale.php(51): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

29 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseLocale->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

30 …/app/Http/Middleware/UseTree.php(59): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

31 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTree->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

32 …/app/Http/Middleware/UseSession.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

33 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseSession->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

34 …/app/Http/Middleware/UseFilesystem.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

35 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseFilesystem->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

36 …/app/Http/Middleware/UseCache.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

37 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseCache->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

38 …/app/Http/Middleware/UpdateDatabaseSchema.php(56): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

39 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

40 …/app/Http/Middleware/UseDebugbar.php(64): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

41 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

42 …/app/Http/Middleware/UseDatabase.php(85): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

43 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

44 …/app/Http/Middleware/ReadConfigIni.php(62): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

45 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

46 …/app/Http/Middleware/HandleExceptions.php(54): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

47 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

48 …/app/Http/Middleware/EmitResponse.php(52): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

49 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

50 …/app/Http/Middleware/PhpEnvironment.php(46): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

51 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

52 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

53 …/index.php(44): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))

54 {main}

fisharebest commented 5 years ago

The fix will only work for new installations.

To fix this on your site, please run the following SQL statement on your database.

alter table wt_favorite change user_id user_id int default null;