When saving a field, during the "Rebuilding Views Natural Sort Indexing Entries", I got the following exception on nodes with long unicode titles:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'content' at row 1: INSERT INTO {views_natural_sort} (eid, entity_type, field, delta, content) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 14588 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => title [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => <A_VERY_LONG_TITLE_WITH_UNICODE_CHARACTERS> ) in views_natural_sort_store() (line 232 of <PATH_TO_MODULES>/views_natural_sort/views_natural_sort.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

karivolas created an issue. See original summary.

karivolas’s picture

This was happening because the php substr() function was used, instead of mb_substr() which supports unicode characters.

  • generalredneck committed 6a24368 on 7.x-2.x
    Issue #2916478 by generalredneck: wrote a test for long unicode.
    
generalredneck’s picture

Status: Active » Fixed

Got this pushed to the latest development release and wrote a test for your fix.

Status: Fixed » Closed (fixed)

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

generalredneck’s picture

Version: 7.x-2.5 » 8.x-2.x-dev
Status: Closed (fixed) » Active
Issue tags: +port to d8

Reopening as it needs to be applied to D8

  • generalredneck committed 7ff4f48 on 8.x-2.x
    Issue #2916478 by karivolas, generalredneck: views_natural_sort_store...
  • generalredneck committed e2159b0 on 8.x-2.x
    Issue #2916478 by generalredneck: wrote a test for long unicode.
    
generalredneck’s picture

Status: Active » Fixed
Issue tags: -port to d8

Ok ported the changes made in Karivolas' patch above to the 8.x-2.x branch... along with tests.

Status: Fixed » Closed (fixed)

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