Very strange bug I noticed today:

I created a Table view of all of my site's nodes, with the node type as a field. While editing the table display settings, I set the "Grouping field" to the node type, so that the results would be grouped by type. I also clicked a few of the checkboxes in the "Hide Empty Columns" column of the table column settings, because some of my content types don't use all the fields that I'm displaying, so this feature allows me to display tables grouped by content type, but without a bunch of empty columns in the tables for types without certain fields (phew, hope that made sense).

However, the last item in each of my tables appears to be duplicated...

Well, to be exact, the fields in the last item are overwritten with the data from the second-to-last-item. For example, a table with just two nodes looks like this:

Title | Body | Edit link
title 1 | body 1 | (edit link)
title 1 | body 1 | (edit link)

The curious part is: the edit link actually points to the correct node. So in the above example, the first edit link brings me to node 1, but the second one brings me to node 2... as it should. So it seems that just the field data itself is being duplicated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m.stenta’s picture

Another detail: I noticed that if I only check off ONE of the columns in "Hide Empty Columns", this doesn't happen.

So it seems to only happen when a grouping field is used, and more than one column is checked off in the "Hide Empty Columns."

Hope that helps.

skyoo8’s picture

I have got the same problem. Its ok to have a grouping field but as soon as I check more than 4 columns as "Hide Empty Columns", last content would not show, instead the content before last one show twice.

Does any one got a solution?

musicologist1964’s picture

Version: 7.x-3.0-rc3 » 7.x-3.0

Hi,

I've encountered the same bug.

My testing has confirmed that if a query is returned that requires more than one column to be hidden (according to the Table Settings), then the last row displayed is partially overwritten by the previous row's details. I can mark as many columns "HIDE EMPTY COLUMN" in Table Settings as I like, and this doesn't affect the output; only the number of columns that actually have to be hidden at the time the query is run seems to affect the last row displayed.

Changing the grouping and/or sorting had no effect on the output.

Cheers,

Garry.

skyoo8’s picture

anyone come up with any solution?

dawehner’s picture

Status: Active » Closed (duplicate)

That's more or less a duplicate of #1235994: When RDF is enabled, grouping can behave incorrectly ... i'm sorry :(

m.stenta’s picture

Status: Closed (duplicate) » Active

Hmm, I'm not so sure. I disabled the RDF module, and my View is still duplicating one of the rows.

dawehner’s picture

Status: Active » Closed (duplicate)

This doesn't have to do with the rdf module itself, but it's the issue linked there.

furberd’s picture

I have the same problem, and replicated on separate Drupal 7 sites. It has nothing to do with grouping, and everything to do with hiding empty columns.

no2e’s picture

Same here as #8

I don't use grouping but "Hide Empty Column" and I have the same problem: last row is duplicated, one is missing.

musicologist1964’s picture

Version: 7.x-3.0 » 7.x-3.2

Hi,

Since confirming that I was experiencing this bug (please see #3 above), I have updated the Views module twice since 31st December, and am now at version 7.x-3.2. However, I am still experiencing this same problem. Additionally, enabling and disabling the RDF module has no effect on the occurrence of the problem.

Can anyone please tell me if there are any plans to address this bug in a future software release, and if there is any indication of when that might happen. It should come as no surprise that I have a website waiting to go live, but I am waiting for this issue to be resolved.

Cheers,

Garry.

kleinmp’s picture

Version: 7.x-3.2 » 7.x-3.x-dev
Status: Closed (duplicate) » Needs review
FileSize
532 bytes

I was having the same behavior as in comment #8 and #9. I'm working off the basic line item view on the order administration page from the commerce module. The only difference is that I added a field to the line items that should be hidden if they're all empty.

The behavior is that the 2nd to last item in the table is shown twice and the last item is not shown. I'm pretty sure that this is a separate issue from #1235994: When RDF is enabled, grouping can behave incorrectly and is still not working for me with the latest dev version.

I dug into it and was able to fix it for my view. It seemed that there was some sort of variable collision that was causing the data in the 2nd to last row to overwrite the data from the last when the table was being rendered.

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Oh i get it, php is really awesome!

Thanks for your patch, it totally make sense.
Committed the patch to 7.x-3.x, let's backport to 6.x-3.x

Dennis82’s picture

thanks, this did the trick!

musicologist1964’s picture

Hi,

I've manually applied the patch at #11 and can confirm it works on my web site. Thank you to all involved.

Cheers,

Garry :)

joeebel’s picture

Thank you, kleinmp!! That worked perfectly. You saved the day.

wooody’s picture

Hello, I test views 7.x-3.3+84-dev and it's not work, and i checked there is this code in theme.inc

if ($empty) {
        foreach ($vars['rows'] as $num => &$column_items) {
          unset($column_items[$column]);
          unset($vars['header'][$column]);
        }

i already checked Hide empty fields in field setting in views ,

so why the empty Td not hide .? it's still exist like this:

any help..

Tara1981’s picture

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

I'm having this issue with 7.x-3.3, do I have to manually add this patch? (I don't really know how to do that!?)
Sorry for the noobie question.

merlinofchaos’s picture

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

No, dereine committed this in Feb. Download 7.x-3.x-dev as there hasn't been a new official release since this commit.

timtk’s picture

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

I am using version 7.x -3.3 and am still having the same problem as the original issue. http://drupal.org/node/1256078#comment-6571422
I thought it was something to do with the view template file I had used but from following this issue I think it maybe related to this.
Not sure if I have implemented the patch correctly in the theme.inc file as there is a similar line of code except it does not have

foreach ($vars['rows'] as $num => &$column_items) {
          unset($column_items[$column]);
           unset($vars['header'][$column]);
         }
       }

Am fairly proficient with view but not the coding side of it and rarely use table views so any help would be appreciated.

heatherwoz’s picture

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

This was fixed in 7.x-3.5. You should upgrade to that if possible. The fix is still waiting to be applied to 6.x so that is why the issue is still open.

timtk’s picture

THANK YOU that did the trick.

Chris Matthews’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (outdated)

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue