jamminben / nossairmandade.com

Source code for nossairmandade.com
0 stars 1 forks source link

hinario infinite loop #26

Open iateadonut opened 1 year ago

iateadonut commented 1 year ago

There is an infinite loop problem in the hinario generator.

it's the loop that starts with: while (count($stanzas) > 0) { in Models/Hinario.php

it is hacked, for now, with the line: if($loops > count($stanzas)) break;

it affects the hinario's: 21 44 46 59 78 126

iateadonut commented 1 year ago

to see what this bug does, go to a hinario pdf and look for the pages with an 'over arrow' but a blank page.

for example, go here: https://nossairmandade.com/hinario/21/NovaAnuncia%C3%A7%C3%A3o/pdf and check page 296

to run the cacher on the command line on the server, you can do: /usr/local/php82/bin/php artisan hinario:cachepdf --all or /usr/local/php82/bin/php artisan hinario:cachepdf --id=21

to regenerate one, you should delete it from this directory: /home/dh_nossa/nossairmandade.com/storage/app/hinario_pdfs

iateadonut commented 1 year ago

I found the culprit:

The line " \r" between stanzas in the full text rather than "\r" between stanzas.

it's fixed in this commit: https://github.com/jamminben/nossairmandade.com/pull/10/commits/d2d4580e518de034959762863d8282e00d981257

but i've found other errors in the process: https://github.com/jamminben/nossairmandade.com/issues/27

i have not tested all of these broken hinarios so i'm leaving this open.