fisharebest / webtrees

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

Error on page blocks #2679

Closed vytux-com closed 5 years ago

vytux-com commented 5 years ago

When pretty urls are set in config

base_url="https://webtrees.vytux.com"
rewrite_urls=1

I get this on the homepage image

When turned off the page loads OK image

https://webtrees.vytux.com/index.php?route=%2Ftree%2Fdev_test%2Ftree-page-block&block_id=23 https://webtrees.vytux.com/tree/dev_test/tree-page-block?block_id=23

Error Text: Undefined index: block_id …/app/Http/Controllers/HomePageController.php:323

0 …/app/Http/Controllers/HomePageController.php(323): Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees{closure}(8, 'Undefined index...', '/var/www/webtre...', 323, Array)

1 …/app/Http/Middleware/WrapHandler.php(73): Fisharebest\Webtrees\Http\Controllers\HomePageController->treePageBlock(Object(Nyholm\Psr7\ServerRequest))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

53 {main}

fisharebest commented 5 years ago

I cannot reproduce this error, and I cannot find an obvious problem.

Do you still see it with the latest code?

I shall rewrite this route so that the URL changes from

/tree/dev_test/tree-page-block?block_id=23

to

/tree/dev_test/tree-page-block/23

This may help you. This may help

vytux-com commented 5 years ago

Yes just tried again with latest GIT and still seeing same results

The only other thing I can add it that this server is on nginx and I configured it pretty urls based on 'laravel' routing info so the config file looks like this:

try_files $uri $uri/ /index.php;

    location ~* \.(?:ico|css|js|gif|jpe?g|png|txt|html)$ {
        expires 7d;
        access_log off;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
vytux-com commented 5 years ago

argh.. my bad

nginx config was missing $is_args$args; from the try_files line

fisharebest commented 5 years ago

Glad you got it sorted!