Stillat / the-agency-starter-kit

The Agency is a free Statamic Starter Kit designed as an example of utilizing various techniques to implement a highly customized Statamic experience.
MIT License
9 stars 3 forks source link

Forms link in the backend gives Fatal Error #3

Closed waynetheisinger closed 11 months ago

waynetheisinger commented 11 months ago

What was I doing

I clicked on the Forms Link in the left hand navigation of the control panel

What did I expect to happen

That the Create Forms starter page would display

What actually happened

https://flareapp.io/share/17WJg63P

waynetheisinger commented 11 months ago

Additional Info: removing all __(<value>) calls in vendor/statamic/cms/resources/views/forms/index.blade.php makes the error go away... which made me think that the first thing is to verify is the translation files and ensure that for every key you're using with the _('key') function, the corresponding value in your translation files (located in resources/lang) is a string, not an array. However, there doesn't seem to be a resources/lang folder... `¯_(ツ)/¯`

waynetheisinger commented 11 months ago

More Info: If you change all instances of __('Forms') to __('Foobar') in vendor/statamic/cms/resources/views/forms/index.blade.php then the error goes away

JohnathonKoster commented 11 months ago

Thanks for the extra info! I'll look to refactor some things this weekend; I ran into a similar problem on another project with recent versions of Statamic

JohnathonKoster commented 11 months ago

I've updated the starter kit to address this issue; you'll need to replace the starter kit's files in order to resolve it (or create a new project with the starter kit).

The root case was the Starter Kit's /lang/en/forms.php translation file, which caused an issue wherever there is __('Forms') (or similar) translations anywhere in the project. I've prefixed these files with agency_ and updated the translation calls.

Happy coding!

waynetheisinger commented 11 months ago

Great - thank you for being so responsive that's perfect!

waynetheisinger commented 11 months ago

@JohnathonKoster - sorry to tell you this, but that broke your Projects view in the Control Panel