You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the subscriptions data store, the $subscription->get_next_payment_date() can result in a null value (e.g. when a phase has a fixed number of periods and the last period has been reached). Updating the meta value with $this->update_meta( $id, 'next_payment', $subscription->get_next_payment_date() ) leaves the meta value unaffected, because there's an empty value check in https://github.com/pronamic/wp-pay-core/blob/3303f7f200796405e74b27f65a0965bad6fe5a77/src/AbstractDataStoreCPT.php#L228-L230
I've now added an explicit check for the null value to delete the post meta:
In the subscriptions data store, the
$subscription->get_next_payment_date()
can result in anull
value (e.g. when a phase has a fixed number of periods and the last period has been reached). Updating the meta value with$this->update_meta( $id, 'next_payment', $subscription->get_next_payment_date() )
leaves the meta value unaffected, because there's an empty value check in https://github.com/pronamic/wp-pay-core/blob/3303f7f200796405e74b27f65a0965bad6fe5a77/src/AbstractDataStoreCPT.php#L228-L230I've now added an explicit check for the
null
value to delete the post meta:Question: Should the
AbstractDataStoreCPT::update_meta()
method also be able to remove post meta if the new value isnull
?The text was updated successfully, but these errors were encountered: