Closed (outdated)
Project:
Quick Tabs
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2011 at 13:37 UTC
Updated:
16 Dec 2024 at 17:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
katbailey commentedQuicktabs can't possible guess at what constitutes "empty" content for all possible things you could put in tabs. It just checks if any markup is returned.
Comment #2
brycesenz commentedUnderstandable. I have posted this issue in the Mediafront queue, since I guess it should be fixed there.
For reference though, can you point me to the line/code that checks whether the quicktabs content is empty? It would make finding the disconnect much easier.
Comment #3
hexabinaerbrycesenz, wouldn't http://drupal.org/node/766924#comment-3485870 be a solution for you?
Comment #4
brycesenz commentedUnfortunately, it's not quite a solution. I ended up dropping MediaFront in favor of another module that doesn't exhibit this issue, but there still seems to be a fundamental disconnect between the way some modules that implement Views style plugins return data and what is expected by quicktabs.
katbailey is right that it's not QT's responsibility to check for whatever each module decides to return when it is empty, but it would still be helpful to note somewhere in the documentation what exactly the module looks for to determine emptiness so that patches can be easily made for other modules.
Comment #5
stealthtech1 commentedI noticed that even though the view was empty it still generated empty div tags.
I then did an override on the view templates and removed all unnecessary html.
But a Krumo dump showed that the view result still had 2 characters in it.
So i minimized the files ensuring that there are no line breaks or hidden spaces anywhere.
Krumo dump now showed that the tab contents result now had 0 characters.
But this still didnt hide the tab.
I then did this small hack to accommodate an empty string:
Quicktabs.classes.inc on line 191 I changed:
if (empty($contents)) {to:
if (empty($contents['#markup'])) {That fixed it for me.
Comment #6
henrijs.seso commentedI would go further and suggest stripping all tags/whitespaces from #markup with something nuclearManaged to fix issue with NOT NULL filter for field to be displayed in view.
Comment #7
Jan van Diepen commentedMy situation is as follows:
I have a quicktabs definition that has a view displays on its tabs. One of the view displays is using the quicktabs style plugin, with more views on the tabs. On these subtabs I wanted to hide the empty tabs. This is not working since hide_empty_tabs defaults to 0 (FALSE).
I added the tab_hide_empty_tabs option to the plugins settings form, to allow the user to decide whether to hide empty tabs or not.
At that moment I ran into the problem that the tabs were not recognized as being empty. Just like stealthtech1 in #5 I noticed that the content holds an empty string in '#markup'. To solve this I added some extra checks on the first line of the constructor of Class QuickPreRenderedContent which is used to render the content of the subtabs.
A similar solution should also do the trick for other classes.
I'm not sure how this translates to the initial Media Player issue.
Please find the patch below.
Comment #8
Binu Varghese commentedFirst off, after you create a quick tab instance, select the the option to "Hide empty tabs" (Make sure the ajax mode is not set).
Now, if the view is truly empty, the tab will gracefully disappear from the tabs. But, how to ensure that the views output is truly empty?
- Simply add a views "filter" setup for the entity you are trying to display set to "Is not empty (NOT NULL)".
Cheers!
Comment #9
smustgrave commentedWith D7 EOL approaching in a month I'm starting to triage the D7 side of quicktabs queue.
If still an issue or needed for 4.0.x (latest branch) feel free to reopen