Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was doing some QA on an internal module that uses export-ui and noticed that clicking the enable/disable links. I tried the same thing on a clean installation using stylizer and noticed the same behavior. I traced it into ctools_export_ui::list_page() which is called by enable_page()/disable_page() to rebuild the table. The critical section seems to be:
$this->rows = array();
$this->sorts = array();
$form_state = array(
'plugin' => $this->plugin,
'input' => $input,
'rerender' => TRUE,
'no_redirect' => TRUE,
'object' => &$this,
);
$help_area = $this->help_area($form_state);
ctools_include('form');
$form = ctools_build_form('ctools_export_ui_list_form', $form_state);
$output = $this->list_header($form_state) . $this->list_render($form_state) . $this->list_footer($form_state);
$this->rows gets cleared and ctools_export_ui_list_form should be submitted, calling list_form_submit() which would rebuild it before list_render() is called. In the non-JS flow it works correctly, I'm trying to figure out what differs.
Comment | File | Size | Author |
---|---|---|---|
#2 | ctools_1132616.patch | 907 bytes | drewish |
#1 | ctools_1132616.patch | 877 bytes | drewish |
After clicking | 37.15 KB | drewish | |
Before clicking | 36.28 KB | drewish |
Comments
Comment #1
drewish CreditAttribution: drewish commentedWith Earl's help I tracked it down to some extra items in the $input array, 'js' => 1 and 'ctools_ajax' => 1. I'm still not quite sure how that throws the spanner in the works but this seems to fix it.
Comment #2
drewish CreditAttribution: drewish commentedSlight rewording of the comment.
Comment #3
wonder95 CreditAttribution: wonder95 commentedI ran into this exact same issue, and the patch fixed it perfectly.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed.