Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access offset of type string on string #2474

Open
jobara opened this issue Jan 20, 2025 · 2 comments
Open

Cannot access offset of type string on string #2474

jobara opened this issue Jan 20, 2025 · 2 comments

Comments

@jobara
Copy link
Collaborator

jobara commented Jan 20, 2025

TypeError

Cannot access offset of type string on string

🎯 /app/helpers.php
🗂 /app/helpers.php:427

425      $settings = settings($key, $default);
426   
427*     return $settings[$locale] ?? $settings[config('app.fallback_locale')];
428  }
429   }

Open in Flare

@jobara
Copy link
Collaborator Author

jobara commented Jan 20, 2025

This occurred during the time that dev was undergoing its nightly reset. It was triggered via the join.blade partial ( /app/resources/views/partials/join.blade.php:14 )

<p>{{ __('Call our support line at :number', ['number' => phone(settings_localized('phone', locale(), '+1-888-867-0053'), 'CA')->formatForCountry('CA')]) }}

@jobara
Copy link
Collaborator Author

jobara commented Jan 20, 2025

In this case, I'd guess that the default value is being returned from settings. However we're still trying to access it like it's an array of localized values but it's only a string was passed in as the default. In this case either the default needs to take the form we are expecting, or if isn't an array of localized values, we simply return it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant