Child pages
  • [in-commerce] Warning, when going from Shipping to Billing step [5.2.2-B1]
Skip to end of metadata
Go to start of metadata

When performing checkout (add product to cart > enter shipping info > enter billing info > preview order > place order) in In-Commerce on Front-End, then following warning happens, when going from shipping to billing step:

Warning (#3): strlen() expects parameter 1 to be string, array given in ...\core\kernel\utility\validator.php on line 267

Stack trace:

In some cases (and shipping step is that case) form can contain non-scalar type fields (e.g. arrays). When these fields are checked with "strlen" (or any other string-only function), then this results in above displayed warning.


Make the following changes to "kValidator::ValidateRange" method:

  1. move detection of value length to top of the method
  2. always use "mb_strlen" function
  3. when field has non-scalar value (checked by "is_scalar" function call), then consider value length as 0

Related Tasks

INP-1571 - Getting issue details... STATUS

INP-1438 - Getting issue details... STATUS