SQLSTATE[22001]: [Microsoft][SQL Server Native Client 11.0][SQL Server]String or binary data would be truncated.
LINE: 46
FUNCTION: print_controller_html()
FILE: xxx\sites\all\modules\print\print.pages.inc
-----------------------------------------
In core, url aliases (and also node paths) can have up to 255 characters:
https://drupal.org/node/288946
(table URL_ALIAS field ALIAS)
But, in this module, in table "print_page_counter" field "path", the maximum size is set to 128.
Should be increased to match de 255 core length, otherwise getting random exceptions when storing data...
$nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
db_merge('print_page_counter')
->key(array('path' => $nodepath))
->fields(array(
'totalcount' => 1,
'timestamp' => REQUEST_TIME,
))
->expression('totalcount', 'totalcount + 1')
->execute();
As a quick fix... just change the size in database manually.
Comments
Comment #1
david_garcia commentedNeeds to be fixed in all these tables:
print_mail_page_counter
print_page_counter
print_pdf_page_counter
Comment #2
jcnventuraDuplicate of #1927110: Increase path size in print_page_counter from varchar(128) to varchar(255)