Problem/Motivation

Deprecated Unicode::strlen() need to be replaced

Proposed resolution

Use mb_strlen() According to https://www.drupal.org/node/2850048

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

akshay_d created an issue. See original summary.

akshay_d’s picture

Status: Active » Needs review
FileSize
676 bytes

replaced deprecated method please review

nJim’s picture

Status: Needs review » Reviewed & tested by the community

The deprecated Unicode::strlen() was replaced with mb_strlen() as specified in the sited core issue. This change was correctly applied in the patch file. There are no other instances of Unicode methods to replace in the pathauto module.

Conducted a function review by defining a pathauto content pattern of '[node:title]' and setting 'Maximum alias length' to 20 characters. Experimented with content with length of 20 or more characters. Test cases included unicode characters greater than 1 byte. Confirmed urls were correctly truncated including the creation of numeric suffixes.

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, looks like I missed that one earlier as it is on the same line as the still required Unicode::truncate().

@nJim, great example of a RTBC comment, exactly describing what you tested and actually testing the relevant part is great, thanks.

  • Berdir committed 52b55a5 on 8.x-1.x authored by akshay_d
    Issue #3036022 by akshay_d: Deprecated Unicode::strlen() need to be...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.