Add guard clause to prevent duplicate tab creation in license admin form#474
Closed
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Closed
Add guard clause to prevent duplicate tab creation in license admin form#474Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Conversation
Signed-off-by: Kaushik <kaushikrjpm10@gmail.com>
Member
|
@Kaushik-Kumar-CEG and @tdruez the fix improves the situation: the "License Data | Assigned Tag Values" box does not repeat endlessly, but is shown only once; however, it should not show up at all. Also, the main menu bar is getting duplicated as well. Same results in Firefox and Chrome. So, there is some progress, but more to do.
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #469
Issue
License admin form tabs ("License Data" / "Assigned Tag Values") were duplicating multiple times, breaking the UI.
Solution
Added
if ($('#license_form > ul').length === 0)guard clause to prevent tab creation code from running multiple times. The tab initialization in$(document).ready())can execute repeatedly due to Django admin AJAX interactions, causing duplicates.Changes
license_library/templates/admin/license_library/license/change_form.html(lines 159-175): Wrapped tab creation in guard clauseTesting
Could not reproduce the bug locally (maybe an intermittent issue).
@DennisClark - Since you originally reported this bug, could you please test this fix in your environment (Starship/nexB) to verify it resolves the duplicate tabs issue? Your testing would be greatly appreciated!