Even with 6.x-3.x-dev 2011-Apr-04 version installed, checking the option

  • Style Settings > Style: table > Style Options > Show the empty text in the table

has no effect on the view.

Always here to help.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Are you 100% sure you have 0 records? Perhaps you need to add some filter to return really 0 records

Is the empty displayed at all?

In general it would help if you could provide more informations, so it's reproducable.

nrdmagnus’s picture

Ok, reproducing the bug:

  1. Create a new content type called TestContent
  2. Create a view to list the nodes of this type configuring:
    • Filters [ Node: Type = TestContent ] [Node: Published Yes ]
    • Fields [ Node: Nid Nid ] [ Node: Title Title]
    • Style settings [ styleStyle: Table ] -> Style options [ √ Show the empty text in the table. ]
  3. Then add a Page display, setting it's path to test-content/all
  4. And add a Block display, configuring it to appear in Content Region (on every page or only on test-content/all)
  5. So, visiting the page you'll see ONE empty table
  6. Try creating a TestContent node
  7. Finally, visiting the page again you'll see TWO tables displaying the recent created node

If you think there's more I can do, just tell me.

davidneedham’s picture

Does this only affect table styles? I can't get empty text to display for any style. I opened another issue for that: #1147384: Empty Text (No Results Behavior) Doesn't Work

esmerel’s picture

Status: Postponed (maintainer needs more info) » Active
Grumot’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

Hi, I have the same problem, also only with the block display.

I use a table formatting and I want the table to appear, even if it is empty. It does with the page display, but not with block display.

Then, I tried to make the things better by configuring the "no result behavior" of the block view. the added text does appear in the first row (and then the empty table is finally here in some way). So it circles well the problem.

I hope that this will help....

dawehner’s picture

Issue tags: -Views Empty text

@Grumot
So would you say that this issue is solved?

Grumot’s picture

Priority: Normal » Minor

Hi, sorry for the delay.

No, I don't think that the problem itself is solved, as the function "show the empty text in table" doesn't work (only the "not-show the empty text in table" works)...

But we can handle this, since using the "no result behavior" has similar results in some way...

priority >> minor fits this situation ;)

thanks

nrdmagnus’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Priority: Minor » Normal
dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Actually the option works fine for me.

In general there is just one option:

Show the empty text in the table
Per default the table is hidden for an empty view. With this option it is posible to show an empty table with the text in it.

Can you give some more context how this is not working?
Are you sure you are on the current 6.x-3.x dev version?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
msbrar’s picture

Version: 6.x-3.x-dev » 7.x-3.0-rc3
Status: Closed (cannot reproduce) » Active

This problem seems to happen when the view appears as a context pane or a block. No table is presented in these cases. However if i add a page view to the view the empty table shows up in the page with the same parameters.

Also, the empty table does show up in the preview in all the three cases. It just doesnt show up when the view is added as a context pane/block in a custom page.

dawehner’s picture

I'm not 100% sure but i think this is sort of a problem of the block display, sadly i can't find the issue handling this anymore.

dawehner’s picture

There is another issue which allows bascially to really know whether a view is empty or still an empty text is shown, though i can't find it right now. This patch would probably help to fix this bug as well.

dawehner’s picture

kait’s picture

I think I have a solution for this issue. The problem seems to be in the block display plugin which does not use even_empty() function that includes the check for "Show the empty text in the table" style option.

Patch included.
Any thoughts welcome :)

aBrookland’s picture

I've come across the same issue with the get locations module style plugin (getlocations_plugin_style_map) which was patched in No results in views issue using the same pattern as the table style.

I traced through the code and found the views_plugin_display_block->execute() function test for even empty using the $this->view->style_plugin->definition['even empty'] but that key didn't exist in the get locations map style definition array.

So I created a simple view with the table style and traced through the code and found exactly the same thing happening for empty tables which has led me to this issue.

So the question is why doesn't that option get set in the definition array?

If it isn't meant to be set in the definition array then why is the execute() function using it? Seems to me the patch in #15 is the way to go.

I've applied the patch and will report back if I come across any problems.

kenorb’s picture

Issue summary: View changes
Status: Active » Needs review

Status: Needs review » Needs work