Whenever I modify the contents of the Header field for a view with Alpha Pager options, I get the following type of errors. Only apparent fix is to delete the view and start over again.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE left(trim(LEADING 'And ' FROM (trim(LEADING 'The ' FROM (trim(LEADING 'A '' at line 1 query: SELECT count(node.nid) FROM node node WHERE (node.type IN ('article')) WHERE left(trim(LEADING 'And ' FROM (trim(LEADING 'The ' FROM (trim(LEADING 'A ' FROM (trim(LEADING '\'' FROM (trim(LEADING '"' FROM (trim(LEADING ' ' FROM (upper(node.title))))))))))))), 1) = 'T' in /home/thomsonh/public_html/includes/database.mysql.inc on line 167.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE left(trim(LEADING 'And ' FROM (trim(LEADING 'The ' FROM (trim(LEADING 'A '' at line 1 query: SELECT node.nid, node.title AS node_title FROM node node WHERE (node.type IN ('article')) WHERE left(trim(LEADING 'And ' FROM (trim(LEADING 'The ' FROM (trim(LEADING 'A ' FROM (trim(LEADING '\'' FROM (trim(LEADING '"' FROM (trim(LEADING ' ' FROM (upper(node.title))))))))))))), 1) = 'T' ORDER BY left(trim(LEADING 'And ' FROM (trim(LEADING 'The ' FROM (trim(LEADING 'A ' FROM (trim(LEADING '\'' FROM (trim(LEADING '"' FROM (trim(LEADING ' ' FROM (upper(node.title))))))))))))), 1), node_title ASC LIMIT 0, 50 in /home/thomsonh/public_html/includes/database.mysql.inc on line 167.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 106638.patch | 820 bytes | douggreen |
Comments
Comment #1
douggreen commentedI can't seem to reproduce this. I'm not quite sure if by "header field" you mean the view "header" text.
If you're willing to help, could you create an account on drupal5.douggreenconsulting.com, signin, create a view, and try to reproduce this problem. I've temporarily given authenticated users access to "administer views".
If you can't reproduce, could you export your view form me.
Thanks!
Comment #2
jibbajabba commentedYes, it's the "header" text for this view. The exported view is below.
To reproduce:
1) create a view page with alpha pager and enter some text into the header textarea.
2) after the view has been saved, edit the view again and modify what you entered in the header textarea.
3) go to the page for the view and the errors should appear.
Thanks for looking at this. -michael
--- start exported view ---
$view = new stdClass();
$view->name = 'resources';
$view->description = 'Featured resources';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Resources';
$view->page_header = '
';
$view->page_header_format = '2';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'resources';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
array (
'type' => 'rss_feed',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'sortable' => '1',
'defaultsort' => 'ASC',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_url',
'field' => 'field_url_url',
'label' => '',
'options' => 'default',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => '',
'handler' => 'views_handler_field_date_small',
'sortable' => '1',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'resource',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_url);
$views[$view->name] = $view;
Comment #3
douggreen commentedI see the error in the SQL:
should be
However, I'm not able to reproduce this on my system. Could you please apply the attached patch to your views_alpha_pager module and let me know if it resolves the problem.
Thanks!
Comment #4
douggreen commentedI had another fix to make, so I added this one. Please just checkout the latest 5.x-1.x-dev release and let know if it works or not. Thanks!
Comment #5
jibbajabba commentedI installed the new version but still getting the same error. Incidentally, I am inputting HTML into the header with Full HTML input filter. I think the header text is a red herring, because if I edit any field this error occurs. I just edited the title and the same thing happens.
This is on RC 1 with Views 5.x-1.4-2rc1. I'm at a loss as to why it doesn't happen on your build.
Comment #6
GripMediaDotNet commentedI am frustratingly getting the same thing. If I add ANY filter it causes the exact same error. Hope we can get fixed as I really need this. Thanks. Drupal 5.0 RC1
$view = new stdClass();
$view->name = 'Views_Alpha_Pager_Test';
$view->description = 'Views Alpha Pager Test';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Views Alpha Pager Test';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = 'None found';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'views_alpha_pager';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'title',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
);
$view->filter = array (
array (
'tablename' => 'node_data_field_history_type',
'field' => 'field_history_type_value_default',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'African American History in the West',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_history_type);
$views[$view->name] = $view;
Comment #7
douggreen commentedThis appears to be the same as 1110012 which I believe I fixed this morning. Iif this is still not working, and is different than 111012, then please re-open the issue.