I am new to Spryker and PHP world, for our spryker...
# help
b
I am new to Spryker and PHP world, for our spryker instance which is underdoing upgrade, I am getting the below error messages. I can understand the value in the
preg_replace()
function does not accept null value. How do I approach to resolve this problem. Any help is appreciated.
p
Hey, how does the code-line looks like?
b
$builder->get(static::_FIELD_PHONE_)->addModelTransformer(new CallbackTransformer( function ($modelToViewValue) { return preg_replace('/\D*/', '', $modelToViewValue); }, function ($viewToModelValue) { return preg_replace('/\D*/', '', $viewToModelValue); }, ));
p
The problem is that $modelToViewValue and $viewToModelValue can both be null in theory. There needs to be an additional check.
b
OK I did add a null check for this variables , but ended up getting another error
image.png
p
never saw that before 😞 sorry, I can not help further here without debugging it by myself.