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?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | quicktabs-log_empty-2222805-14.patch | 882 bytes | Delphine Lepers |
Comments
Comment #1
JvE commentedQuick 'n dirty patch to at least get rid of the endless logging.
Comment #2
pkloos commentedI made the logging optional and changed the error message to a constant to prevent typos from breaking the code.
Comment #3
jay.lee.bio commentedThanks 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.
Comment #4
khosman commentedI'm finding same issue as wwwjaylee - the patch works great (and is much needed, thanks!) - but the checkbox doesn't stay checked.
Comment #5
JvE commentedA quicktab not having content is not unexpected. No exception should be thrown.
Comment #6
nwom commentedHere is a new patch that fixes the issue mentioned in #3. Please review.
Comment #7
JvE commentedNo exception should be thrown when there is no content.
Comment #8
dtamajon commentedI 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.
Comment #9
nwom commentedComment #11
Anonymous (not verified) commentedAdded patch#8:
I don't us "Hide empty tabs".
In watchdog the 'There are no contents to render' items are gone.
Comment #12
nwom commented#8 does not apply cleanly to the newest dev. The following error is shown when applying it via git:
fatal: corrupt patch at line 23However, #6 still applies cleanly.
Comment #13
Delphine Lepers commentedHere is a new patch on dev version.
It solves the issue even if you don't use ajax.
Comment #14
Delphine Lepers commentedComment #15
Delphine Lepers commentedComment #16
nwom commented#15 applies cleanly to newest dev and works great.
Comment #18
smustgrave commentedSince this was already RTBC I'll go ahead and include.