Working with the latest dev snapshot (7.x-3x-dev) from 2010-Jan-05 I get the following error.

An error occurred while attempting to process /views/ajax: Cannot call method 'toLowerCase' of undefined

This error appears after creating a user-based view, with Ajax enabled, a page, the user e-mail as field and the user name as exposed filter, going to the page, entering 'admin' in the field and pressing apply.

CommentFileSizeAuthor
#12 1015960-12-exposed_filters_ajax.patch743 bytesduellj

Comments

jelle_s’s picture

oh, and using drupal 7.0

jelle_s’s picture

Version: 7.x-3.x-dev » 7.x-3.0-alpha1

Changing this to alpha1 version.
Error is still there.

dawehner’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev

Move back to dev.

dawehner’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 7.x-3.x-dev » 7.x-dev
Component: exposed filters » other

The error message:

An error occurred while attempting to process /d7/?q=views/ajax: a.tagName is undefined

This seems to be a problem of core:

         var parentTag = row.parent().get(0).tagName.toLowerCase();
ryan.armstrong’s picture

Where in core is that?

dawehner’s picture

includes/tabledrag.js.

ryan.armstrong’s picture

Dereine: Thanks for pointing me to this duplicate issue. I'm still having the issue that when I turn AJAX off, the exposed filter disappears. Do you think this is related to this issue or a separate issue? I looked at my page code, and the filter isn't being hidden or display:none or anything, it just doesn't exist. I want to know if I should open a separate issue for that behavior, or if you think that this is all related to this toLowerCase bug.

Perhaps the issue is that something isn't being created correctly in views, so that when Drupal tries to go and create the table, information it needs is gone, thus the toLowerCase bit fails. I wonder if this is not a core issue, but still an issue with views, but part of the Table style rather then the filter system?

ryan.armstrong’s picture

Ok, I was incorrect about it being part of the Table style. I changed the style to unformatted and I still get the same issues. I changed my theme to Bartik, just to double check, same result. I see the same thing happening in the views preview. With AJAX off, no exposed filters show up If I turn it on, I can then see the exposed filters but I get the above AJAX error.

minff’s picture

It rather seems to be a problem of jquery.form.js, which is the only file in D7 that contains "a.tagName", or more exactly "a.tagName.toLowerCase" (i.e. error texts by FF and Chrome respectively).
Oh, and I see the same thing as described by Jelle_S: whenever I click on apply on an exposed filter of a view, the described error pops up. Ajax is never called (the error is output by ajax.js, row 256).
I'm using Drupal 7.0, Views 7.x-3.0-alpha1 and Ctools 7.x-1.0-alpha2.

ryan.armstrong’s picture

minff: Quick question, if you turn off AJAX, can you see the exposed form still? Does everything work just minus the AJAX?

minff’s picture

@Ryan: Yes, everything works when I turn off Ajax.

duellj’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 7.x-dev » 7.x-3.x-dev
Component: other » Code
Status: Active » Needs review
StatusFileSize
new743 bytes

This is actually a bug in ajax_views.js. Here's what's happening:

Drupal.ajax expects the second parameter to be a DOM element. Views instead passes in a jQuery object containing the DOM element, so when Drupal.ajax tries to operate on that object (like retrieving the tagName) it fails. All that has to be done is pass in the actual DOM element instead of the jQuery object, which is what this patch does.

duellj’s picture

Component: Code » exposed filters

Setting to correct component

minff’s picture

Status: Needs review » Reviewed & tested by the community

Well, will you look at that, it works! Thanks.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks.

Tested with a node and a user based view, with and without ajax.

This patch fixes the problem.

Commited to the 7.x branch.

Status: Fixed » Closed (fixed)

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

thechanceg’s picture

Status: Closed (fixed) » Active

I am using the views_load_more module, with the latest views 3.X dev from Jan-09-12.

I am getting this exact same error. And, as described above, if I turn off ajax for the view it works fine (albeit with a page refresh of course) I checked js/ajax_view.js and the patch from above was committed. Has anything changed since then that might cause this issue to pop up again?

I am also using drupal 7.0 if that makes a difference.

Export of the view, if that helps:

$view = new view;
$view->name = 'photo_grid';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Photo Grid';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'load_more';
$handler->display->display_options['pager']['options']['items_per_page'] = '6';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['style_options']['row_class'] = 'matrix-cell';
$handler->display->display_options['row_plugin'] = 'entity';
$handler->display->display_options['row_options']['view_mode'] = 'matrix';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'flickr_upload' => 'flickr_upload',
  'light_box' => 'light_box',
  'upload_image' => 'upload_image',
);
thechanceg’s picture

Status: Active » Closed (fixed)

It looks like Drupal 7.0 was the issue. I upgraded to 7.10 and the errors are gone.

j0rd’s picture

I'm getting this error when I attempt to "add no results behaviour" in views.


Drupal.viewsUi.OptionsSearch.prototype.handleKeyup = function (event) {
  var found, i, j, option, search, words, wordsLength, zebraClass, zebraCounter;

  // Determine the user's search query. The search text has been converted to
  // lowercase.
  search = this.$searchBox.val().toLowerCase();
  // ^--- error occurs here