fisharebest / webtrees

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

V2 Control panel edit user throws error #2640

Closed ddrury closed 5 years ago

ddrury commented 5 years ago

Unresolvable dependency resolving [Parameter #0 [ int $id ]] in class Fisharebest\Webtrees\Tree …\vendor\illuminate\container\Container.php:975 +lots more error lines

fisharebest commented 5 years ago

Edit user is working for me.

lots more error lines

Can you post the next few lines....

ddrury commented 5 years ago

Interestingly, I just added a user and I can edit him so it's just me (user id 1) that causes the error, I attach an image of the wt_user_settings table showing the differences (the only differenc with the other use tables is that the new user doesn't exist in the database. wt_user_setting

Unresolvable dependency resolving [Parameter #0 [ int $id ]] in class Fisharebest\Webtrees\Tree …\vendor\illuminate\container\Container.php:975

0 …\vendor\illuminate\container\Container.php(913): Illuminate\Container\Container->unresolvablePrimitive(Object(ReflectionParameter))

1 …\vendor\illuminate\container\Container.php(854): Illuminate\Container\Container->resolvePrimitive(Object(ReflectionParameter))

2 …\vendor\illuminate\container\Container.php(816): Illuminate\Container\Container->resolveDependencies(Array)

3 …\vendor\illuminate\container\Container.php(667): Illuminate\Container\Container->build('Fisharebest\Web...')

4 …\vendor\illuminate\container\Container.php(615): Illuminate\Container\Container->resolve('Fisharebest\Web...', Array)

5 …\app\Helpers\functions.php(45): Illuminate\Container\Container->make('Fisharebest\Web...')

6 …\app\Date.php(252): app('Fisharebest\Web...')

7 …\app\Individual.php(567): Fisharebest\Webtrees\Date->display()

8 …\resources\views\selects\individual.phtml(6): Fisharebest\Webtrees\Individual->getLifeSpan()

9 …\app\View.php(202): include('D:\Server\nginx...')

10 …\app\View.php(298): Fisharebest\Webtrees\View->render()

11 …\app\Helpers\functions.php(195): Fisharebest\Webtrees\View::make('selects/individ...', Array)

12 …\resources\views\components\select-individual.phtml(32): view('selects/individ...', Array)

13 …\app\View.php(202): include('D:\Server\nginx...')

14 …\app\View.php(298): Fisharebest\Webtrees\View->render()

15 …\app\Helpers\functions.php(195): Fisharebest\Webtrees\View::make('components/sele...', Array)

16 …\resources\views\admin\users-edit.phtml(316): view('components/sele...', Array)

17 …\app\View.php(202): include('D:\Server\nginx...')

18 …\app\View.php(298): Fisharebest\Webtrees\View->render()

19 …\app\Helpers\functions.php(195): Fisharebest\Webtrees\View::make('admin/users-edi...', Array)

20 …\app\Http\ViewResponseTrait.php(48): view('admin/users-edi...', Array)

21 …\app\Http\Controllers\Admin\UsersController.php(314): Fisharebest\Webtrees\Http\Controllers\AbstractBaseController->viewResponse('admin/users-edi...', Array)

22 …\app\Http\Middleware\WrapHandler.php(72): Fisharebest\Webtrees\Http\Controllers\Admin\UsersController->edit(Object(Nyholm\Psr7\ServerRequest))

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

24 …\app\Module\HitCountFooterModule.php(140): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

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

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

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

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

29 …\app\Http\Middleware\Router.php(133): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))

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

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

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

33 …\app\Http\Middleware\LoadRoutes.php(55): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

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

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

36 …\vendor\illuminate\database\Concerns\ManagesTransactions.php(29): Fisharebest\Webtrees\Http\Middleware\UseTransaction::Fisharebest\Webtrees\Http\Middleware{closure}(Object(Illuminate\Database\MySqlConnection))

37 …\app\Http\Middleware\UseTransaction.php(45): Illuminate\Database\Connection->transaction(Object(Closure), 3)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

61 …\vendor\middlewares\client-ip\src\ClientIp.php(81): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))

62 …\app\Http\Middleware\ClientIp.php(46): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))

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

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

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

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

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

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

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

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

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

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

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

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

75 …\index.php(43): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))

76 {main}

ddrury commented 5 years ago

Adding a gedcomid in the user_gedcom_setting table causes the error

ddrury commented 5 years ago

... and shouldn't that be user_id?

fisharebest commented 5 years ago

This is actually quite a horrible problem to solve properly...

The selector for an individual includes the lifespan alongside the name.

Formatting dates requires a tree. This is because the format includes conversions to other calendars, which is a per-tree setting.

This has been implemented as a global $tree for years.

As part of the code cleanup, we are getting rid of global/session state. This makes everything more predictable, testable, etc.

So, we no longer have a session tree variable, that is no longer being written to a global tree variable.

The result is that on pages with no tree, we cannot (currently) format dates.

I guess we could simply detect the missing tree, and not apply calendar conversions here....

ddrury commented 5 years ago

Have fun :-)

fisharebest commented 5 years ago

Also, dates include links to the calendar page - which requires a tree...