statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
3.71k stars 508 forks source link

Lang file causing an error #7672

Closed elmanvebs closed 7 months ago

elmanvebs commented 1 year ago

Bug description

When you add a language file with the filename forms at /resources/lang/{lang} it throws an error when viewing the blueprints page cp/fields/blueprints in CP.

Error:

htmlspecialchars(): Argument #1 ($string) must be of type string, array given (View: /vendor/statamic/cms/resources/views/blueprints/index.blade.php)
image

How to reproduce

Create a file with the name forms in lang folder.

Logs

No response

Environment

Statamic
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.4.5 PRO

Installation

Existing Laravel app

Antlers Parser

runtime (new)

Additional details

No response

duncanmcclean commented 1 year ago

Possibly related: #2341 #5116 #4852

jasonvarga commented 1 year ago

Yes same issue. Workaround in this comment. https://github.com/statamic/cms/issues/2341#issuecomment-741799811

jasonvarga commented 1 year ago

Actually sorry that should already be fixed. What page are you getting that error on?

jasonvarga commented 1 year ago

Oops again. I see the problem. 😄 We can get that sorted.

I thought https://github.com/statamic/cms/pull/5144 solved it, but it only fixed for when the word is in the navigation. If you have the word "Forms" on a page (or whatever the filename you created), it'll also throw the error.

ilicmarko commented 1 year ago

There is this same issue for Email on login. The workaround works.

https://github.com/statamic/cms/blob/bbdb937a31bc281dd639209e584aa00d716caac4/resources/views/auth/login.blade.php#L40

ryanmitchell commented 9 months ago

@jasonvarga is the answer here to replace all __() in the views folder with Statamic\trans() ?