'Tab content' is empty and 'Operations' is not styled when adding a tab with Ajax

Created on 20 June 2013, almost 12 years ago
Updated 10 December 2024, 4 months ago

Problem/Motivation

Steps to reproduce:

  1. Install and enable quicktabs 7.x-3.x-dev
  2. Go to admin/structure/quicktabs/add
  3. Click on the 'Add tab' button at the bottom of the form
  4. The table should look like screenshot 1, i.e. 'Tab content' and 'Operations' columns are properly displayed
  5. Make sure that at least one of the tab titles is empty so the form won't validate
  6. Click on the 'Save' button

Expected result: 'Tab content' and 'Operations' columns should still show up like on screenshot 1.

Actual result: 'Tab content' is empty and 'Operations' is not styled, as displayed on screenshot 2.

Proposed resolution

The problem is that:

  • The content of 'Tab content' is updated by using $('#quicktabs-form') in the js
  • The styles of 'Operations' is updated by using '#quicktabs-form' in the css
  • Drupal changes the form ID from 'quicktabs-form' to 'quicktabs-form--2' when it is udpated with Ajax - see drupal_html_id()

The problem could be fixed by using a form class (.quicktabs-form) instead of the form ID (#quicktabs-form and #quicktabs-form--2).
Such solution is implemented in the patch provided at #1.

Remaining tasks

Reviews and tests are welcome.

Related Issues

The following issue might be related, though the 'Operations' column does not seem to be affected: πŸ› Content tabs chose block not showing on edit tab interface Closed: outdated

πŸ› Bug report
Status

Postponed: needs info

Version

3.0

Component

User interface

Created by

πŸ‡¨πŸ‡¦Canada fengtan Montreal, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024