The Views title is getting duplicated on all ds 7.x branches 1.5, 1.x, and 2.x when using Views Title field and the results are empty.

The page title hides correctly when the results are not empty.

Comments

joelpittet’s picture

Trying to track down where this happen, leads me to believe this may not be a DS issue.

hook_entity_view_alter doesn't seem to be firing for a view with no results because there is technically no entities being rendered.

That is my two cents... I wonder if there is another hook for this?

swentel’s picture

Status: Active » Postponed (maintainer needs more info)

Could you check if ds_vd_render_title_field() is called twice (maybe change the value it's return there) ? Or inspect with firebug to see what wrappers are printed ? The ultimate thing is to add a debug_bactrace() (or ddebug_backtrace from devel) to find out why (although it's hard for me to tell where to actually place the backtrace).

joelpittet’s picture

ds_vd_render_title_field is not getting called twice. It's getting called and rendered once as expected.

It's the original page title that is getting added because hook_entity_view_alter doesn't fire to hide it when no entities are rendered in the view. Just a no results view global text.

swentel’s picture

Hmm, and this is a page view right ? I should test it because I should see what happens :)

swentel’s picture

Also, I always see two titles anyway on a page view if I manage the layout through views and drag the views title into a layout, so I'm guessing this is rather by design than a bug.

joelpittet’s picture

swentel’s picture

Ok, so this means you configured the node to remove the page title, right ? That's actually been reverted in the latest dev since that's actually wrong behavior. A node which is not rendered as it's own page, shouldn't have control over that. That would mean we should add support for that page title option also for views, which I know 've set to won't fix a couple of times, but maybe I'll have to reconsider. However, I'm not sure if I can make that work since the magic for views happens in a preprocess function, which will probably to late for the page title to change.

swentel’s picture

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

Ok, so that fix mentioned in #8 actually isn't really fixed for hiding the titles. I've been able to reproduce this with a full nodes in my right sidebar where I opted to hide the page title. This shouldn't happen at all as it's wrong behavior.

swentel’s picture

Status: Active » Fixed

Ok, Display Suite views now has the option to hide title (not rewrite at this point as I don't see much value in that) when managing the layout.
Only 7.x-2.x for now, will see if people want this for 7.x-1.x as well.

http://drupalcode.org/project/ds.git/commit/aabf0c0

(accidentily delete the patch already on my local system)

joelpittet’s picture

1.5 seems a bit more stable than 2.x right now, so I am putting my hand up for 1.x too. But I will give 2.x another try and submit a few more bugs if they are still there(field form settings were failing last).

joelpittet’s picture

Status: Fixed » Closed (fixed)

Great work, that solves 2.x

aspilicious’s picture

Status: Closed (fixed) » Fixed

Just leave this fixed for now, so we can track this better. It will close automaticly after two weeks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.