I read quite a few threads about 500 errors linked to PDF since my template editor started giving me 500 errors, too.
I was pulling my hair quite a bit since yesterday and I was in the process of writing a long debugging thread until I found the exact problem, so that might affect others: my glitch was due to ModSecurity running on my server. Simply disabling it on the subdomain I have Invoice Ninja installed on fixed all the errors that would be triggered when trying to create/load/view/edit/save templates.
Curiously, the “Playful” template was the only one working fine with ModSecurity, and I tried on a test install to copy its data under the “design” column in the database to the “Hipster” entry, and to my surprise, “Hipster” started loading too. It thus seems that ModSecurity might be parsing and flagging wrongly something in the html source for some templates in the database, since it allows some specific code and makes some other code crash.
So all in all, for those getting 500 Errors with template editing or PDF generation, this might do the trick.
I’d gladly do that, but I’m not sure how to do that exactly. I clicked on your link and when I click on New pull request I get Choose different branches or forks above to discuss and review changes. Not sure what to compare to what from there…