This is a fairly benign issue but I thought I would mention it as it will prove frustrating if it pops up out of the blue.
I have a view block that uses a Grid format with 4 columns and a set of filters that will display anywhere from 2 to 32 items. The Grid settings are default except for being 4 columns wide.
The issue is that although the table is set to have 4 columns, if the number of items to return are less than 4 (ie: 2) the table will only produce that number of columns. In my case one filter produces two items so the table that was set to span 100% with 4 td elements with widths of 25% ended up a table at 100% and only 2 td elements. Not the end of the world and I was able to adjust the CSS stylesheet to make up for it but this is a different behaviour from the 7–3.3 version and may trip someone else up.
Comment | File | Size | Author |
---|---|---|---|
#79 | grid_format_disregards-1744478-79.patch | 529 bytes | schiavone |
| |||
#38 | views-fill_up_single_row-1744478-38.patch | 875 bytes | skwashd |
#33 | Schermafbeelding 2013-04-21 om 14.29.03.png | 89.44 KB | remixed |
#33 | Schermafbeelding 2013-04-21 om 14.29.09.png | 50.33 KB | remixed |
#33 | Schermafbeelding 2013-04-21 om 14.29.15.png | 103.32 KB | remixed |
Comments
Comment #1
couturier CreditAttribution: couturier commentedYes, it seems several people are having problems with some of the settings being undone during the upgrade from 3.3 to 3.4. You might refer to these other two issues and close this one if any of that information helps solve your problem. These two issues below may not be exactly the same as what you are facing, but they could be related.
Update to 7.x-3.4 un-sets the boolean operator in filters
Upgrade is cancelling boolean operator settings
Comment #2
awasson CreditAttribution: awasson commentedNope, different issues. I commented on those when I ran across those last night and resolved them in one of my sites.
This is entirely an issue with the way the HTML for the table is outputted and I believe 7.x–3.4 ignores the checkbox setting for "Fill up single line" which is on in this case and on by default.
Comment #3
awasson CreditAttribution: awasson commentedWell 7.x–3.5 is out and fixes the boolean bug but the Grid view is still not outputting the correct number of TD's.
Comment #4
dawehnerThis seems to be caused by #1371252: Table with "Hide Empty Column" and "Grouping field" creates duplicate last content
Comment #5
awasson CreditAttribution: awasson commented@dawehner: Do you think so? I'm not sure that it is.
This is a new behavior that only began with the 7.x–3.4 / 7.x–3.5 updates. 7.x–3.3 was outputting the correct number of TD elements regardless whether there was data or if they were empty cells.
Thanks,
Andrew
Comment #6
Ace Cooper CreditAttribution: Ace Cooper commentedHappens to me as well - Views 3.5 ignores the "Fill the last row" setting for a single row.
To better demonstrate it, see some screenshots:
1. Views respects "Fill up last row" setting when there are several rows.
2. Views ignores "Fill up last row" setting with only single row of results.
Comment #7
awasson CreditAttribution: awasson commentedYes, the second JPG illustrates exactly the issue I ran into. The outputted code should generate a table with 4 TD elements but only generates 2 which forced me to go in and change the CSS as a temporary work-around.
The code difference is as follows:
Comment #8
Ace Cooper CreditAttribution: Ace Cooper commentedTo make Views correctly fill up a single row I edited the
views/theme/theme.inc
line 692 (Views 3.5):and changed it to:
Attached below you will find a simple patch for this feature. Voilà!
P.S. "If you want something done well - do it yourself" Mr.Zorg, 5th Element.
Comment #9
Ace Cooper CreditAttribution: Ace Cooper commentedComment #10
Bitou Deouf CreditAttribution: Bitou Deouf commentededit: nevermind...
Comment #11
Bernsch CreditAttribution: Bernsch commentedPatch from #8 works for me!
Thanx!
Comment #12
MustangGB CreditAttribution: MustangGB commentedRelated: #1773798: For the grid format "Fill up single line" does not work when using vertical alignment for a single row
Comment #13
Ace Cooper CreditAttribution: Ace Cooper commentedChanged title to better describe the problem and closed the issue.
I dropped the version description:
Update from 7.x–3.3 to 7.x–3.4/7.x-3.5
since version is tagged within issue.
I can not imagine a case, where we would like an item from single line of results have a different width than items from multiple lines.
If someone can produce such a usecase - feel free to reopen this issue and we will have to add a corresponding checkbox to the grid formater options.
Comment #14
awasson CreditAttribution: awasson commented@Ace Cooper: Thanks for adjusting the title and putting together the patch in #8 but shouldn't we keep the issue open until it has been committed to the next views update?
Comment #15
MustangGB CreditAttribution: MustangGB commentedIf you don't wish to work on the issue please unassign yourself, but this has not been committed so is not yet fixed.
Comment #16
Ace Cooper CreditAttribution: Ace Cooper commentedJust stumbled on a bug, related to #12.
When content in grid is vertically aligned - single line of results is still not filled: screenshot.
Will look into it later, my content will fill up the line for sure.
P.S. And another strange behaviour when the line is almost finished, but two nodes are missing: screenshot
O O O O O O O
O O O O O
Comment #17
caktux CreditAttribution: caktux commentedThumbs up for #8, thanks!
Comment #18
ditcheva CreditAttribution: ditcheva commentedI'm not sure that #8 solves the original issue reported. It does not for me, in any case.
I have a simple view that displays images (nothing else), and the grid settings are as follows:
Grouping: none
Number of columns: 4
Alignment: Horizontal
Fill up single line: checked
In Firefox, the columns are never what I specify, but simply fill up the entirety of the page width. In IE, it's even worse with the images running past my page. Images are attached!
Any other ideas (other than #8) for what may be causing this?
Comment #19
mengi CreditAttribution: mengi commentedHaving the same issue as OP and #8 patch works for me. Thanks!
Comment #20
lightstring CreditAttribution: lightstring commented#8 patch helped me too. In case it doesn't break any functionality and has no negative effects, will it be commited so one will not need to hardcode again after updating the module?
Comment #21
Bernsch CreditAttribution: Bernsch commented@ditcheva
Try thise one in your CSS file:
Comment #22
ditcheva CreditAttribution: ditcheva commentedThanks, @Bernsch, but this does not fix my issue in IE (view still looks exactly as in my screenshot), and in Firefox, it actually stacks my tds in a single column vertically.
It seems that the patch fixes the issues for everybody else on this thread, so I may just be missing something. On the other hand, if anyone else continues to experience issues even when they apply the single line change in #8, speak up. :-)
For the moment, as a work-around, I have modified my grid views to instead use the 'unformatted list' display, because at least that does not run off the page in IE, even though you cannot specify the number of columns.
Comment #23
klaasvw CreditAttribution: klaasvw commentedThe patch from #8 also fixed the issue for me.
I'm setting this issue to RTBC:
- Several people already replied it works for them.
- A similar issue (#12, #16) that was not fixed has been reported separately and will require a different fix.
- The issue from #22 is most likely a client side issue unrelated to his fix.
Comment #24
queenvictoria CreditAttribution: queenvictoria commentedPatch in #8 fixes the issue for me. (Horizontal alignment)
Comment #25
Rafix CreditAttribution: Rafix commentedHi everybody!
The pach in #8 didn't fixed the issue for me. It get closer the fields each other in the columns but never fixed it totally.
I am ussing a responsive theme (I don't know if have something to do) Pixture Reloaded (adaptive theme).
Do you know something new about this issue?
Thanks!
Comment #26
dawehner@Rafix
Have you tried the same problem with a theme provided by drupal core? If it's working on that one, we are fine, and this is just a problem of this custom/other contrib theme. Feel free to post an issue on one of these queues.
Comment #27
Rafix CreditAttribution: Rafix commented@dawehner
Thank you for your answer. I've tried in Bartik and I think that is happening the same thing. I attach jpg with both themes in order you can see it.
Any answer will be great! Thank you again.
*I edit for further information.
In the attached jpg files I am using the patch in #8
Comment #28
dawehnerSo I guess the status can't be rtbc anymore, sorry
Comment #29
jcsnyder CreditAttribution: jcsnyder commentedFor me, a combination of patch in #8 and table-layout:fixed; applied to table did the trick. Thanks a ton everybody!
Comment #30
pfrenssenMarked #1949574: "Fill up single line" not working since update to 7.x-3.6 as a duplicate of this issue.
Comment #31
rrrob CreditAttribution: rrrob commentedIssues #18 & #25 above most likely due to CSS. Please provide incorrect HTML if you believe my statement is in error.
I have tested this patch with the settings as per the attached screenshot.
Resetting this to RTBC. This needs to be committed.
Comment #32
Ace Cooper CreditAttribution: Ace Cooper commented@Rafix: Of course, you have to apply some CSS to get it working! (screenshot 1, screenshot 2)
I forgot to mention *he said sarcastically*, that after my patch in #8 I also set the size of
<td>
's with CSS.While without #8 table cells of single line ignore the width setting and fill up the space of missing
<td>
's.Please, commit the patch already.
I have to apply this fix to my 4th project in a row.
Comment #33
remixed CreditAttribution: remixed commentedThe problem I have is the same, but only happens when less then 2 rows are used for a item.
The #8 fix doens't work for me, does anyone else know the problem?
Comment #34
Ace Cooper CreditAttribution: Ace Cooper commented@remixed:
Show me the HTML of your
<table>
and your CSS for<td>
elements, not the rendered pages.You clearly forgot to apply CSS, something like
td { width: 25%; }
(for fixed width table) ortd { width: 250px; }
(for fluid width table).The patch does not fix CSS output for every custom theme, but it restores missing
<td>
s in table output of views.It's not the fault of patch #8, but the archaic behaviour of
<table>
s, introduced back in 1997.Read #32 carefully, look at
screenshot 2
there.Comment #35
Rafix CreditAttribution: Rafix commented@Ace Cooper
Thank you man. That was the problem. Now it is fixed!
Comment #36
rrrob CreditAttribution: rrrob commentedAce Cooper is correct. This patch *only* fixes the HTML output. Since it will output empty
<td>
s to fill the row, you must use CSS to give the<td>
some width.Comment #37
Bernsch CreditAttribution: Bernsch commentedOK, i think we can commited to dev :-)
Comment #38
skwashd CreditAttribution: skwashd commentedThe patch from #8 is no longer applying cleanly against 7.x-3.x-HEAD. Rerolled version attached.
Comment #39
RedEight CreditAttribution: RedEight commented#38 correctly fills up the tr with empty tds. CSS is still needed to get the desired effect.
CSS that worked for a 4 column grid
Just adjust cols-4 and the width to match your specific case. Basically cols-n needs width 1/(n).
Recommend that #38 be committed if test passes.
#38: views-fill_up_single_row-1744478-38.patch queued for re-testing.
Comment #40
jseltzer CreditAttribution: jseltzer commentedPatch in 38 works perfectly
Thanks!
Comment #41
MustangGB CreditAttribution: MustangGB commentedThis is still RTBC.
Comment #42
metakel CreditAttribution: metakel commentedPatch in 38 works. After patching Views generates the correct number of "TD" tags even if the number of rows is fewer than the number of columns in the grid.
The latest dev version 7.x-3.7+21-dev and the stable version 7.x-3.7 both have this problem and both are not patched. Please proceed and commit it to them!
Comment #43
metakel CreditAttribution: metakel commentedI found that in the newly released 7.x-3.7+22-dev (Jan 11, 2014), the problem is still there. I have to patch the file as in #38 again to make the grid works normally.
Comment #44
caktux CreditAttribution: caktux commentedGet this in already! Wake up! Yes, I could turn off notifications. No, it's not the solution. Commit this now, it's been well over a year, reviewed and circlejerked around enough. Thank you.
Comment #45
pfrenssenPlease do not mess with the priorities to try to promote patches. That doesn't help getting it in faster. The patch will be committed in time at the maintainers' discretion.
In the meanwhile if you are affected by this problem, you can apply the patch.
Comment #46
caktux CreditAttribution: caktux commentedI'm not promoting it by changing the priority, this is where the priority should have been all along. I've commented and patched it long ago, I'm complaining because new users still hit those problems which are major because it is so trivial to have the right number of columns on single rows.
Comment #47
awasson CreditAttribution: awasson commentedI'm not going to comment either way about the severity of the issue but I agree with caktux. Let's get the patch at #38 rolled into Views. If there's a reason why the patch can't be applied, let's hear why. It's hard to be motivated to fix problems like this (however simple) when after we've done the work to patch and test, there's no activity.
Comment #48
couturier CreditAttribution: couturier commentedIt's true that hours of work are wasted on many Drupal modules because patches aren't committed within a reasonable time frame. This discourages people from contributing. Sometimes it is easier to get a patch committed if it is fixed in D8 first and then offered for D7. However, the grid table template will be replaced with one using divs for D8, so it is a completely different format. See [Change notice] Replace the views grid table template with one using divs
I agree this patch should be committed, but if maintainers say they do not have time, then D8 is coming soon and the problem there should be resolved.
Comment #49
thomas1977 CreditAttribution: thomas1977 commentedBeen working for hours in order to find out why it wasn't possible to show correct number of td's/columns when output results are less than the grid setting. Been pulling my hair out. FINALLY found this thread - so, thanks!
However: any timeline from maintainers for when the patch get's integrated in a release/dev version? ...so we don't have to do manual patching (something that I haven't done before)...
Best
Edit: don't want to sound impatient, really, but this IS truly annoying, not least considering that Views is otherwise such an amazing (!!) peace of software.
Comment #50
mengi CreditAttribution: mengi commentedD8 is coming soon and will be resolve the issue is not a good solution...
I've been using this module (https://drupal.org/project/views_responsive_grid) and it has worked well for me. Instead of using tables, it uses divs. Hope that helps someone out.
Comment #51
majorrobot CreditAttribution: majorrobot commentedWorks well for us, too. It's a very small, logical change — would love to see this in the next release!
Comment #52
thomas1977 CreditAttribution: thomas1977 commented@ #50 - Thanks, will try this as soon as possible!
Comment #53
david_garcia CreditAttribution: david_garcia commented+1 please commit.
Comment #54
nowidid CreditAttribution: nowidid commented+1 please commit #38. Thanks!
Comment #55
hoangdk80 CreditAttribution: hoangdk80 commentedWorked for me, commit +1
Comment #56
3CWebDev CreditAttribution: 3CWebDev commented+1 for #38 Patch. Is this going into core?
Comment #57
Daniel Kulbe+1 for patch #38
Comment #58
PhilYpatch #38 works fine with Views 7.x-3.8
Comment #59
khiminrm CreditAttribution: khiminrm commented#38 works for me too. Views 7.x-3.8
Comment #60
alh CreditAttribution: alh commentedPatch #38 works for me with 7.x-3.8. I'm actually pretty shocked that this hasn't been committed. Seriously this is an ancient issue. And a simple fix. I work in both Wordpress and Drupal and I am beginning to think Wordpress is winning the hearts and minds of developers. No they are not perfect but there seem to be many fewer issues with Wordpress. Perhaps the Drupal community needs to focus on maintaining the current, mainstream releases as opposed to the new and shiny updates in Drupal 8 and 9.
Comment #61
egor.malygin CreditAttribution: egor.malygin commentedGuys, why is this not in the release yet?
Comment #62
liezie_D CreditAttribution: liezie_D commented+1 for patch #38 on Views 7.x-3.8.
please commit
Comment #69
Caligan CreditAttribution: Caligan commented#38 worked for me. Patch applies cleanly to latest.
Comment #72
Caligan CreditAttribution: Caligan commentedI don't understand what's going on with this. The patch works fine, but the error output where it's breaking down appears to imply that something is wrong with the tests. Anybody cleverer than me know what this output means?
Output: [ERROR: Unknown argument 'sites/default/modules/views/tests/node/views_node_revision_relations.test,sites/default/modules/views/tests/comment/views_handler_filter_comment_user_uid.test, [...] ,sites/default/modules/views/tests/views_query.test,sites/default/modules/views/tests/views_argument_validator.test,sites/default/modules/views/tests/templates/views-view--frontpage.tpl.php'.].
Comment #74
petednz CreditAttribution: petednz commentedso it is failing even to fail now?
Comment #75
Ace Cooper CreditAttribution: Ace Cooper as a volunteer commentedLots of time has passed and yet this issue is still around.
It's like developers don't even pay attention to the threads any more.
Just updated an old website to Views 7.x-3.x-dev from a two-year-old Views 7.x-3.8-ish installation. Got the same problem. And my patch from #8 still works fine.
Comment #76
thomas1977 CreditAttribution: thomas1977 commented@ Ace Cooper
I've been hesitating to apply your patch hoping for at "proper release". But simply couldn't wait anymore - and guess what: your patch works perfectly so far.
Thanks!
Best,
Thomas
Comment #77
schiavone CreditAttribution: schiavone at Snake Hill Web Agency commentedThis is an issue for views 7.x-3.14 in either vertical or horizontal alignment.
Comment #78
MustangGB CreditAttribution: MustangGB commentedSure, but the patch has to chase dev, that's just how the issue queue works.
Comment #79
schiavone CreditAttribution: schiavone at Snake Hill Web Agency commentedRe-rolled patch for 7.x-3.x-dev
Comment #80
schiavone CreditAttribution: schiavone at Snake Hill Web Agency commentedIs that a pass I see? Perhaps we can get this into dev now?
Comment #81
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedPatch #79 is the same as my patch (#38) except that the bot wants to test it. I can't RTBC this as it is my essentially my own patch.
Comment #82
MustangGB CreditAttribution: MustangGB commentedComment #83
schiavone CreditAttribution: schiavone at Snake Hill Web Agency commented@skwashd Yep, looks like the testbot was looking for standard naming conventions for the patch. My participation was not in creation, only editorial ;-)
Comment #84
TenaMurphy CreditAttribution: TenaMurphy as a volunteer commentedHaving the same issue as OP and #8 (= #79 patch) works for me. Thanks Ace Cooper!
I'm using views 7.x-3.14 and Omega 3.x subtheme which already set the necessary CSS. One line change from #8 was all I needed.
Comment #85
RedEight CreditAttribution: RedEight at 95Visual commentedPatch #79 worked fantastically! Thanks skwashd and schiavone.
Comment #86
petednz CreditAttribution: petednz commentedMarking as RTBC since I am seeing 2 'works for me'. hope that is okay.
Comment #87
DamienMcKennaBumping to the next release.
Comment #88
DamienMcKennaI think this might need a change notice, as it could affect the output for some sites.
Comment #89
DamienMcKennaTaking this off the plan for the next release, will consider it later.
Comment #90
MustangGB CreditAttribution: MustangGB commentedIs this later enough yet?
Comment #92
DamienMcKennaCommitted. Thanks all.
Could someone please work on a change notice?