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

[3.1] White labelling error when using multiple logo's and env variables #3394

Closed
robdekort opened this issue Mar 18, 2021 · 5 comments
Closed

Comments

@robdekort
Copy link
Contributor

robdekort commented Mar 18, 2021

Bug Description

When using multiple custom logo URL's this doesn't work:

'custom_logo_url' => [
    'nav' => env('STATAMIC_CUSTOM_LOGO_NAV_URL', null),
    'outside' => env('STATAMIC_CUSTOM_LOGO_OUTSIDE_URL', null)
]

Gives an error:

ErrorException
htmlspecialchars() expects parameter 1 to be string, array given (View: /Users/robdekort/Sites/anne-meithe/vendor/statamic/cms/resources/views/partials/global-header.blade.php)

It wil work when you set the logo's to empty strings, but then the CP doesn't fallback to the default logo's.

Screenshot 2021-03-18 at 15 55 04

How to Reproduce

Try to use .env variables for setting the nav and outside logo in config/statamic/cp.php like above.

Extra Detail

Screenshot 2021-03-18 at 15 52 11

Environment

Statamic 3.1.0-beta.1 Pro
Laravel 8.33.1
PHP 7.4.13
No addons installed

Install method (choose one):

  • Starter kit
@robdekort robdekort changed the title [3.1] White labelling issue with multiple logo's [3.1] White labelling error when using multiple logo's and env variables Mar 18, 2021
@duncanmcclean
Copy link
Member

If you run php artisan tinker and enter config('statamic.cp.custom_logo_url'), what's returned?

@robdekort
Copy link
Contributor Author

This is what's returned when it's set to null. Then I get the above error. Screenshot 2021-03-19 at 19 47 56

When I set the env to nothing I don't get the error, but here's no logo in the CP nav bar. Then it returns this.

Screenshot 2021-03-19 at 19 49 16

So with the current options it seems you can't keep the default Statamic logo in the nav bar.

@robdekort
Copy link
Contributor Author

robdekort commented Mar 22, 2021

I just noticed this on another site which might be relevant:
Screenshot 2021-03-22 at 15 32 28

@jasonvarga
Copy link
Member

On that site, have you published the views? Do you have a login.blade.php?

@robdekort
Copy link
Contributor Author

Yep, that was it indeed. I just wanted to remove my comment. Hahaha. And it seems you fixed the initial issue already. Awesome!

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

4 participants