Closed (outdated)
Project:
Semantic Views
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 May 2010 at 21:04 UTC
Updated:
1 Apr 2017 at 07:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Scott Reynolds commentedI believe this issue is related: #773238: Reduce white space and line breaks in HTML output?. Essentially, the field output was comprised of new lines and therefore not empty. I suspect that if you did a
it would make the hide if empty work again.
Comment #2
Scott Reynolds commentedDoing that makes it work with user profile pictures who return something different when the row is empty. Which is why Earl did it that way to begin with Im sure...
Comment #3
gausarts commentedYou solved the problem with my vud listings. No matter what I did in the .tpl files, the empty row still holds the markup.
Thank you.
Comment #4
gausarts commentedAh, darn. The pagers won't go away, it still counts the empty rows. Sorry to get excited too soon :(
Comment #5
Scott Reynolds commentedthis patch doesn't deal with empty rows. It deals with empty columns in the row. And if fixes a bug where Semantic Views doesn't work the same way as the normal Fields row plugin works.
What you are trying to achieve doesn't sound like Views can handle it. Its not a Row style plugin issue its a Views issue.
Comment #6
Anonymous (not verified) commentedScott: I'm happy to commit this patch, but I am a bit confused. Can you clarify before I commit? Why don't Views 2 or 3 also trim the output in template_preprocess_views_view_fields() ?
Comment #7
Scott Reynolds commentedbecause of the linked issue above, Semantic Views adds new line to the output.
Perhaps its better to fix the new line, so prevent adding new line to the output from the style plugin->get_field() when the field is empty.
Comment #8
Anonymous (not verified) commentedScott: I still don't understand. White space collapses in HTML unless it's wrapped in <pre> or if it's in an element that is styled with CSS white-space: pre or pre-wrap.
If a field is empty and the row option skip_blank or the field option hide_empty is enabled, the field and its label aren't added to the template variables, just like Views 2. If these options aren't enabled, the empty field value may swim in a sea of white space, but that won't matter.
Are you using PRE? Is this a workaround for a buggy browser that doesn't support standard HTML?
I need to see an example of this bug.
Comment #9
Scott Reynolds commentedSure, but
prints not empty. Which is a simplified version of
This means that hide when empty doesn't work when the $view->style_plugin->get_field() returns "\n"
Comment #10
Anonymous (not verified) commentedOk Scott. I'm sorry for being so "unreachable" on this issue. Thanks for your patience in helping me understand it.
The template issue is a red-herring then. Semantic Views does not add any lines to the output. The preprocess function we're patching is for the template with the excess white space. The field output is being rendered by the field handler.
I want to verify that this happens in Views without Semantic Views plugins enabled. If it does, this needs to be patched in Views as well. Can you share the View that has "\n" in the output? You said it was related to the user picture field?
Comment #11
Scott Reynolds commentedIt doesn't thats how I decided to open an issue here.
Interestly, I see what you are getting at. views_plugin_style::get_fields(). Strange that this is returning non-empty stuff
The field handler in question is just views_handler_field.
I might spend some more time on it but honestly, this patch fixed it for us. Its no longer a bug. And Views standard style plugins worked just fine and behaved properly. It has to be a bug here, just not sure why.
Comment #12
henrijs.seso commentedsubsc.
Comment #13
Scyther commented