Skip to content

Force cast to prevent type error (php8.4 + null instead of string/array) #333

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

Closed
wants to merge 2 commits into from

Conversation

thomas-kl1
Copy link

Description

Fix the following error

1 exception(s):
Exception #0 (Exception): Deprecated Functionality: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/project/magento/vendor/klaviyo/magento2-extension/Block/Catalog/Product/ViewedProduct.php on line 217

Manual Testing Steps

Any products without prices

@thomas-kl1 thomas-kl1 requested a review from a team as a code owner June 4, 2025 15:15
@klaviyoit klaviyoit requested a review from smoucka June 4, 2025 15:15
Copy link
Contributor

@smoucka smoucka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @thomas-kl1 . This looks good to me. Would you mind updating CHANGELOG.md to reflect the change? 🙏

Copy link
Contributor

@smoucka smoucka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thomas-kl1 !

@smoucka
Copy link
Contributor

smoucka commented Jul 23, 2025

Apologies for not merging this, I realized that $value must be numeric and not an empty string when sending to Klaviyo's API. This issue was addressed in #335 and will be released soon.

@smoucka smoucka closed this Jul 23, 2025
@thomas-kl1 thomas-kl1 deleted the patch-1 branch July 23, 2025 14:37
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