All my pages (350000+) have a block with two quicktabs at the bottom.
I've set the tabs to be hidden when there's no content in them.
Only a couple of hundred pages actually have content in one or both of the tabs.

This results in an InvalidQuickSetException to be thrown from Quickset->prepareContents for almost all my pageviews.
And in watchdog an entry 'There are no contents to render.', quickly filling up the logs.

Surely there must be a better way to hide a block when no tabs have content in them than to throw and log an exception?

Comments

JvE’s picture

Status: Active » Needs review
StatusFileSize
new579 bytes

Quick 'n dirty patch to at least get rid of the endless logging.

pkloos’s picture

StatusFileSize
new3.23 KB

I made the logging optional and changed the error message to a constant to prevent typos from breaking the code.

jay.lee.bio’s picture

Thanks guys, #1 looks fine but #2 definitely works better for me (even for 7.x-3.6 that I'm using). It also works with another patch for using in AJAX mode. The only thing that doesn't work perfectly is the option "Do not log errors for empty quicktabs". Here's how to reproduce the problem:

1) The option does technically get saved, but the checkbox itself is never checked afterwards.
2) So I went back and changed another option, and clicked on the "Save" button after purposely forgetting to check "Do not log errors for empty quicktabs" again, just to see what happens.
3) I go to a page that I know has an empty Quick Tabs block.
4) I check the log to find the dreaded "There are no contents to render." message.
5) So I have to make sure to ALWAYS check the "Do not log errors for empty quicktabs" option before clicking "Save".

I'm not a developer, but will happily review a patch that takes care of this final problem.

khosman’s picture

I'm finding same issue as wwwjaylee - the patch works great (and is much needed, thanks!) - but the checkbox doesn't stay checked.

JvE’s picture

A quicktab not having content is not unexpected. No exception should be thrown.

nwom’s picture

StatusFileSize
new3.25 KB

Here is a new patch that fixes the issue mentioned in #3. Please review.

JvE’s picture

Status: Needs review » Needs work

No exception should be thrown when there is no content.

dtamajon’s picture

StatusFileSize
new678 bytes

I propose a different approximation, using the existing "Hide empty tabs": as we want to hide empty tabs, then don't throw exception on no contents.

nwom’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: quicktabs.patch, failed testing. View results

Anonymous’s picture

Added patch#8:
I don't us "Hide empty tabs".
In watchdog the 'There are no contents to render' items are gone.

nwom’s picture

#8 does not apply cleanly to the newest dev. The following error is shown when applying it via git:

fatal: corrupt patch at line 23

However, #6 still applies cleanly.

Delphine Lepers’s picture

StatusFileSize
new1.04 KB

Here is a new patch on dev version.
It solves the issue even if you don't use ajax.

Delphine Lepers’s picture

Status: Needs work » Needs review
Delphine Lepers’s picture

StatusFileSize
new882 bytes
nwom’s picture

Status: Needs review » Reviewed & tested by the community

#15 applies cleanly to newest dev and works great.

  • smustgrave committed 05ebe9b1 on 7.x-3.x
    Issue #2222805 by Delphine Lepers, nwom, JvE, dtamajon, pkloos, khosman...
smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

Since this was already RTBC I'll go ahead and include.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.