Commit 7721bb4a authored by wyrdwright's avatar wyrdwright Committed by generalredneck

[#2081571] Truncating the title to only 255 characters.

This is being done so that when a title is longer than that or is
transformed into something longer than that, it won't cause a PDO error.

Conflicts:

	views_natural_sort.module
parent a6aae1ea
...@@ -64,6 +64,7 @@ function views_natural_sort_store_multiple(array $index_entries) { ...@@ -64,6 +64,7 @@ function views_natural_sort_store_multiple(array $index_entries) {
} }
function views_natural_sort_store($index_entry) { function views_natural_sort_store($index_entry) {
//This should take a formatted object and store it into the views_natural_sort table. //This should take a formatted object and store it into the views_natural_sort table.
$string =
return db_merge('views_natural_sort') return db_merge('views_natural_sort')
->key(array( ->key(array(
'eid' => $index_entry['eid'], 'eid' => $index_entry['eid'],
...@@ -130,7 +131,10 @@ function views_natural_sort_encode($index_entry) { ...@@ -130,7 +131,10 @@ function views_natural_sort_encode($index_entry) {
$string = $transformation_method($string); $string = $transformation_method($string);
} }
return $string; // The size limit on the content field for views_natual_sort is sometimes not
// enough. Lets truncate all data down to that size. I personally feel the
// inaccuracy is an acceptable loss.
return substr($string, 0, 255);
} }
function views_natural_sort_get_transformations($index_entry) { function views_natural_sort_get_transformations($index_entry) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment