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

fix: Passing null to parameter #1 ($string) of type string is deprecated #244

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

francoism90
Copy link
Contributor

[2024-08-09 20:11:06] laravel.WARNING: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated in /app/vendor/spatie/laravel-html/src/BaseElement.php on line 300  
[2024-08-09 20:11:06] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [deprecations] is not defined. at /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:231)

My log is filling up with the following message on PHP 8.3.10.

This should fix the warning

@francoism90
Copy link
Contributor Author

@freekmurze Could you please take a look at this? :)

@francoism90
Copy link
Contributor Author

francoism90 commented Oct 16, 2024

Could someone please look at this?

2024-10-16 17:50:07] laravel.WARNING: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated in /app/vendor/spatie/laravel-html/src/BaseElement.php on line 300  
[2024-10-16 17:50:07] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [deprecations] is not defined. at /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:231)
[stacktrace]
#0 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(138): Illuminate\\Log\\LogManager->resolve()
#1 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(125): Illuminate\\Log\\LogManager->get()
#2 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(114): Illuminate\\Log\\LogManager->driver()
#3 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(103): Illuminate\\Log\\LogManager->channel()
#4 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(72): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleDeprecationError()
#5 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#6 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#7 /app/vendor/spatie/laravel-html/src/BaseElement.php(300): htmlentities()
#8 /app/vendor/spatie/laravel-html/src/Html.php(409): Spatie\\Html\\BaseElement->text()

This happens when you erase an input, or the field is not fully init yet (e.g. on Livewire).

@sebastiandedeyne sebastiandedeyne merged commit 167e5b8 into spatie:main Oct 18, 2024
@francoism90
Copy link
Contributor Author

@sebastiandedeyne Many thanks for the merge, and having patience with my comments. 🙏

@sebastiandedeyne
Copy link
Member

Thanks for the fix! 😄

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

Successfully merging this pull request may close these issues.

2 participants