Skip to content

Fixed deprecated warning passing null to str_replace#82

Merged
tdwesten merged 1 commit intotdwesten:mainfrom
indykoning:patch-2
Feb 7, 2026
Merged

Fixed deprecated warning passing null to str_replace#82
tdwesten merged 1 commit intotdwesten:mainfrom
indykoning:patch-2

Conversation

@indykoning
Copy link
Contributor

This was a warning that i noticed in our monitoring

str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in vendor/tdwesten/statamic-builder/src/Repositories/BlueprintRepository.php on line 79

Which seems correct since the Statamic getNamespaceAndHandle method can indeed return null for the namespace:
https://github.com/statamic/cms/blob/2724468e1d305910fe16079a0ade8d83e8f13d62/src/Fields/BlueprintRepository.php#L346

Looking at the rest of this function, having a null namespace will always result in this function returning null. So it's better to just short circuit and return null immediately

@tdwesten tdwesten requested review from Copilot and removed request for Copilot February 7, 2026 11:32
@tdwesten tdwesten merged commit 36a3865 into tdwesten:main Feb 7, 2026
10 checks passed
@tdwesten
Copy link
Owner

tdwesten commented Feb 7, 2026

@indykoning Merged! Thanks!

@indykoning indykoning deleted the patch-2 branch February 7, 2026 22:55
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