Skip to content

Data binding: make sure field_name is a string #558

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

Merged
merged 1 commit into from
May 22, 2025
Merged

Conversation

pkevan
Copy link
Contributor

@pkevan pkevan commented May 22, 2025

Otherwise a fatal error occurs when nothing is configured.

Fixes #556.

@pkevan pkevan requested a review from a team as a code owner May 22, 2025 10:12
@pkevan pkevan requested review from chriszarate and removed request for a team May 22, 2025 10:12
Copy link
Contributor

Test this PR in WordPress Playground.

@chriszarate
Copy link
Member

@pkevan This doesn't quite track for me. Where was the fatal being thrown?

> php -a
Interactive shell

php > $foo = [];
php > $bar = $foo['foo'] ?? '';
php > var_dump( empty( $bar ) );
bool(true)

@chriszarate
Copy link
Member

Ah, I suppose it's when it's passed to BlockBinding::get_block_fallback_content(). We could adjust the type hint there, but this works too.

@pkevan
Copy link
Contributor Author

pkevan commented May 22, 2025

Ah, I suppose it's when it's passed to BlockBinding::get_block_fallback_content(). We could adjust the type hint there, but this works too.

Apologies - missed that part in the description!

@pkevan pkevan merged commit 862831e into trunk May 22, 2025
13 checks passed
@pkevan pkevan deleted the fix/issue-556 branch May 22, 2025 15:14
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.

Remote HTML block: fails when incorrectly configured
2 participants