The port of the ctools autosubmit feature of d7 doesn't work in d7.
$view = new view;
$view->name = 'test1';
$view->description = '';
$view->tag = '';
$view->base_table = 'node';
$view->human_name = '';
$view->core = 6;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['autosubmit'] = 1;
$handler->display->display_options['exposed_form']['options']['autosubmit_hide'] = 0;
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['links'] = 1;
$handler->display->display_options['row_options']['comments'] = 0;
/* Filter: Node: 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']['exposed'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['label'] = 'Node: Type';
$handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
$handler->display->display_options['filters']['type']['expose']['reduce'] = 0;
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['path'] = 'exposed';
$translatables['test1'] = array(
t('Defaults'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('Node: Type'),
t('Page'),
);
This example does reproduce the issue if you have ctools installed.
Comments
Comment #1
dawehnerHere is a patch which fixes the issue.
The general problem is that
this here links to an object which doesn't have the bind() method of submit() but only in the case of auto-submit
Comment #2
eugenmayer commentedhehe :)
Just added documentation to the patch, so we could remember the decision
Comment #3
eugenmayer commentedjust better docs + forgot about return false, must have been drunken writing those lines..
/me notes, the summary is wrong ( The port of the ctools autosubmit feature of d7 doesn't work in d7.) ...
rather means "it does not work in D6"..just to not confuse people :)
Comment #4
eugenmayer commentedwell, after testing it, i recognised we forgot about the use-ctools-ajax button, which double-binds the submit button. Added this to the patch
Comment #5
esmerel commentedtrigger testbot?
Comment #6
esmerel commentedComment #7
eugenmayer commented@esmerel, did it already got applied to 6.x? or do you test it in 7.x and fix it downstream?
Comment #8
dawehnerCurrently the process of fixing things is to get it fixed first in 7.x-3.x and then in 6.x-3.x. The patch didn't got committed.
It might be though different here, because views uses in d7 the core ajax api instead of it's own custom stuff,
so the problem shouldn't exist, but i'm not sure.
I wouldn't see myself as being able to review this change, i know the patch fixes something, but that's all.
Comment #9
eugenmayer commented@ Daniel: Iam not very sure, that bug does not exist in D7, depends on the implementation. This fix is rather unexpected, as the current browsers do not fire "onsubmit" if you execute .submit() on a dom-level method, on the other hand the onsumbit event are triggered, when you actually "really" press the button (UI). I did not look at th W3C RFC, maybe that behavior is documentated / whished, but yet, its implementeted that way in all browsers. Let me sum this up
1. A button gets pressed in the browser ( UI )
- a event "onsubmit" is triggered, and all its handlers
2. $('subbutton').get(0).submit() is executed ( DOM method, not jquery)
- NO "onsubmit" event is generated
So, programmatically submitting a button properly means, triggering the event "onsubmit" manually - to be bullet proof to have the same "behavior" as pressing the button ( case 1 ).
Conclusioin:
- This yet cannot be considered a browser bug - or at least, its "buggy" in all browser then (bug would depend on what the RFC tells us )
- the need of this fix is unexpected somekind, but well, lets deal with that
Comment #10
esmerel commentedYeah sorry, I didn't test anything but I thought the patch was against 7.x so I changed teh version. IF that was incorrect I apologize!
Comment #11
dawehnerLet's move it to 6.x-3.x
Ctools 7.x-3.x has a rewritten js with at least a timeout for the textfield.
Comment #12
eugenmayer commentedjust saying that it pretty much works well for the D6 branch, used it for nealry one year. Pitty i have to maintain a own D6 branch due to this issue .. anyway, i guess since the D7 patch needs to be done it cannot be applied by policy.
Comment #13
chris matthews commentedThe Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue