JesseWebDotCom / webtrees-theme-modern

A theme for webtrees, optimized for a mobile and modern experience
22 stars 3 forks source link

Error: Failed to open stream #1

Closed hartenthaler closed 1 year ago

hartenthaler commented 2 years ago

I like your great theme! It looks very good on large and especially on small screens.

There is an error in my test installation: ErrorException: readfile(http://ahnentest.hartenthaler.eu/index.php?route=%2Fmodule%2F_webtrees-theme-modern_%2FAsset&asset=css%2Fpalettes%2Fcolorful%20%28white-blue-pink%29-min.css&hash=1663104152): Failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml:61 Stack trace: #0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}() #1 /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml(61): readfile() #2

rasasak commented 2 years ago

After instalation ... just error

ErrorException: readfile(https://webtrees.rasasak.eu/index.php?route=%2Fmodule%2F_webtrees-theme-modern_%2FAsset&asset=css%2Fpalettes%2Fcolorful%20%28white-blue-pink%29-min.css&hash=1664295362): Failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /www/rasasak.eu/webtrees.rasasak.eu/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml:61 Stack trace: #0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}() #1 /www/rasasak.eu/webtrees.rasasak.eu/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml(61): readfile() #2 /www/rasasak.eu/webtrees.rasasak.eu/app/View.php(183): include('...') #3 /www/rasasak.eu/webtrees.rasasak.eu/app/View.php(278): Fisharebest\Webtrees\View->render() #4 /www/rasasak.eu/webtrees.rasasak.eu/app/Helpers/functions.php(145): Fisharebest\Webtrees\View::make() #5 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/ViewResponseTrait.php(54): view() #6 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/RequestHandlers/TreePage.php(87): Fisharebest\Webtrees\Http\RequestHandlers\TreePage->viewResponse() #7 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/RequestHandler.php(54): Fisharebest\Webtrees\Http\RequestHandlers\TreePage->handle() #8 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RequestHandler->process() #9 /www/rasasak.eu/webtrees.rasasak.eu/app/Module/HitCountFooterModule.php(154): Middleland\Dispatcher->handle() #10 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Module\HitCountFooterModule->process() #11 /www/rasasak.eu/webtrees.rasasak.eu/app/Module/CheckForNewVersion.php(115): Middleland\Dispatcher->handle() #12 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Module\CheckForNewVersion->process() #13 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/CheckCsrf.php(80): Middleland\Dispatcher->handle() #14 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckCsrf->process() #15 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle() #16 /www/rasasak.eu/webtrees.rasasak.eu/app/Webtrees.php(275): Middleland\Dispatcher->dispatch() #17 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/Router.php(153): Fisharebest\Webtrees\Webtrees::dispatch() #18 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\Router->process() #19 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/BootModules.php(60): Middleland\Dispatcher->handle() #20 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BootModules->process() #21 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/RegisterGedcomTags.php(54): Middleland\Dispatcher->handle() #22 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterGedcomTags->process() #23 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/LoadRoutes.php(75): Middleland\Dispatcher->handle() #24 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\LoadRoutes->process() #25 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/CheckForNewVersion.php(65): Middleland\Dispatcher->handle() #26 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckForNewVersion->process() #27 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseTransaction.php(45): Middleland\Dispatcher->handle() #28 /www/rasasak.eu/webtrees.rasasak.eu/vendor/illuminate/database/Concerns/ManagesTransactions.php(29): Fisharebest\Webtrees\Http\Middleware\UseTransaction::Fisharebest\Webtrees\Http\Middleware\{closure}() #29 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseTransaction.php(46): Illuminate\Database\Connection->transaction() #30 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTransaction->process() #31 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/DoHousekeeping.php(73): Middleland\Dispatcher->handle() #32 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\DoHousekeeping->process() #33 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseTheme.php(69): Middleland\Dispatcher->handle() #34 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTheme->process() #35 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/CheckForMaintenanceMode.php(51): Middleland\Dispatcher->handle() #36 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckForMaintenanceMode->process() #37 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseLanguage.php(71): Middleland\Dispatcher->handle() #38 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseLanguage->process() #39 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseSession.php(78): Middleland\Dispatcher->handle() #40 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseSession->process() #41 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UpdateDatabaseSchema.php(57): Middleland\Dispatcher->handle() #42 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process() #43 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/UseDatabase.php(118): Middleland\Dispatcher->handle() #44 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process() #45 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/BadBotBlocker.php(233): Middleland\Dispatcher->handle() #46 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process() #47 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/CompressResponse.php(73): Middleland\Dispatcher->handle() #48 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CompressResponse->process() #49 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/ContentLength.php(40): Middleland\Dispatcher->handle() #50 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ContentLength->process() #51 /www/rasasak.eu/webtrees.rasasak.eu/vendor/middlewares/client-ip/src/ClientIp.php(65): Middleland\Dispatcher->handle() #52 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process() #53 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process() #54 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle() #55 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process() #56 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/BaseUrl.php(79): Middleland\Dispatcher->handle() #57 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process() #58 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/ReadConfigIni.php(68): Middleland\Dispatcher->handle() #59 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process() #60 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle() #61 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process() #62 /www/rasasak.eu/webtrees.rasasak.eu/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle() #63 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process() #64 /www/rasasak.eu/webtrees.rasasak.eu/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle() #65 /www/rasasak.eu/webtrees.rasasak.eu/app/Webtrees.php(275): Middleland\Dispatcher->dispatch() #66 /www/rasasak.eu/webtrees.rasasak.eu/app/Webtrees.php(262): Fisharebest\Webtrees\Webtrees::dispatch() #67 /www/rasasak.eu/webtrees.rasasak.eu/index.php(51): Fisharebest\Webtrees\Webtrees->httpRequest() #68 {main}

dddesign commented 1 year ago

same/similar error at my installation. any help?

Shaashimov commented 1 year ago

Finally get it to work by changing the following in the default.phtml file (resources>views>layouts):

<?php // combine all CSS files so they can share variables echo('<style type="text/css">'); foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) { readfile(e($stylesheet)); } echo('</style>'); ?>

replace it by: `<?php foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>

    <?php endforeach ?>`

I hope this will work for you all :)

JesseWebDotCom commented 1 year ago

see if this new release fixes the issue: https://github.com/JesseWebDotCom/webtrees-theme-modern/releases/tag/v2.1.16.1

hartenthaler commented 1 year ago

No, V2.1.16.1 doesn't fix it: ErrorException: readfile(http://ahnentest.hartenthaler.eu/index.php?route=%2Fmodule%2F_webtrees-theme-modern_%2FAsset&asset=css%2Fpalettes%2Fcolorful%20%28white-blue-pink%29-min.css&hash=1676317070): Failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml:65 Stack trace: #0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}() #1 /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/modules_v4/webtrees-theme-modern/resources/views/layouts/default.phtml(65): readfile() #2 /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/app/View.php(183): include('...') #3 /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/app/View.php(278): Fisharebest\Webtrees\View->render() #4 /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtreestest/app/Helpers/functions.php(145): Fisharebest\Webtrees\View::make() #5

JesseWebDotCom commented 1 year ago

Sounds like the file isn't there? can you check? /resources/css/palettes/colorful (white-blue-pink)-min.css

and can you open and does it have readable content?

JesseWebDotCom commented 1 year ago

also how are you running webtrees? I'm running in docker

hartenthaler commented 1 year ago

The file /resources/css/palettes/colorful (white-blue-pink)-min.css is there and the content is readable.

My webtrees is running on a shared hosted server. Pretty URL is not active on this installation.

HRN65 commented 1 year ago

I see the same error on both shared hosted server and local wampserver

hartenthaler commented 1 year ago

The two modifications suggested by raslani and me in https://www.webtrees.net/index.php/en/forum/4-customising/37307-new-theme-modern allow me to use this theme.

JesseWebDotCom commented 1 year ago

The raslani fix will create problems with shared variables. Can you see if the problem is lack of permission using the readfile method? Basically that code snippet is reading different css files and joining the content in an inline style. If you do not have permissions to call readfile, then I believe you will get this error.

hartenthaler commented 1 year ago

The fixes by raslani and me are no real fixes, more like dirty hotfixes. I have to test more carefully about the readfile call.

JesseWebDotCom commented 1 year ago

Good news - this theme has been completely rewritten and your issue has been addressed: https://github.com/JesseWebDotCom/webtrees-theme-modern/releases/tag/0.0.1