Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Deprecated Unicode::strlen() need to be replaced
Proposed resolution
Use mb_strlen() According to https://www.drupal.org/node/2850048
Comment | File | Size | Author |
---|---|---|---|
#2 | deprecated_unicode_method-3036022-2.patch | 676 bytes | akshay_d |
|
Comments
Comment #2
akshay_dreplaced deprecated method please review
Comment #3
nJim CreditAttribution: nJim at Four Kitchens commentedThe 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.
Comment #4
BerdirThanks, 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.