What's weird is that http://drupal.org/project/exclude_node_title is configured to only work on "Full content" display and not the "tokens"

Steps to reproduce:
1. Install metatag and configure it to use a [node:title] token
2. Install exclude_node_title and configure it to exclude node titles during "Full content" display
3. Create a node

Expected results:
Token [node:title] is replaced with the node title.

Actual results:
The [node:title] is not replaced because the title in $options['token data'] in getValue is empty.

I assume this is a bug in metatag, but it could easily be a bug in exclude_node_title as well.

Comments

Dave Reid’s picture

I'm not sure what we can do if a module is unsetting the raw $node->title value which is the only reason this could be caused by the module.

greggles’s picture

My theory is that metatag is requesting tokens for the full node view instead of building them for the token display.

Dave Reid’s picture

Yes, but no matter the view mode / display settings, you cannot do anything if the data doesn't actually exist in the node.

greggles’s picture

Title: incompatible with exclude_node_title even though exclude_node_title is only configured to affect "Full content" display » incompatible with metatag even though exclude_node_title is only configured to affect "Full content" display
Project: Metatag » Exclude Node Title

Sure, let's see what they have to say about it.

greggles’s picture

Also, maybe make a warning somewhere about the incompatibility?

DamienMcKenna’s picture

Status: Active » Closed (duplicate)
greggles’s picture

Status: Closed (duplicate) » Active

@DamienMcKenna - theoretically the two modules should be able to work together so let's keep this open since the other issue is just about documenting the incompatability, this one can be about making them work together.

gabrielu’s picture

Actually ENT removes the title at node_view. So ipotetically, if Metatag module loads node information for tokens, this will not affect at all, as it will only load node_load hooks.

Correct me if I'm wrong...

Gabriel

Dave Reid’s picture

Because PHP modifies objects by "reference" by default, the modification to the $node->object in exclude_node_title_node_view() is going to affect anything that uses the $node object further in the stack, or anything from node_load() or node_load_ multiple() (with $reset = FALSE). I would expect this behavior is unwanted and would be ideal if exclude node title didn't rely on modifying the direct title itself and could rely on preprocessing instead, but I also have no idea how that would work in reality.

cfox612’s picture

I'm using the latest stable releases of both the Exclude node title and Metatag modules, and there does not seem to be any interaction. Both work as expected.

fizk’s picture

Title: incompatible with metatag even though exclude_node_title is only configured to affect "Full content" display » Incompatible with metatag module
Component: Code » Integration with other modules/themes
Category: bug » feature
fizk’s picture

@greggles, I've made some changes to the latest dev so that $node->title = ''; is avoided. Can you verify that this works for you?

fizk’s picture

Status: Active » Closed (fixed)

Sorry, couldn't wait :P I went ahead and tested it with the latest metatag dev and it seems to work. Please reopen if it doesn't work for you.

DamienMcKenna’s picture

@fizk: Metatag currently displays the following message in admin/reports/status if this module is enabled:

The Metatag module's default settings for content types (nodes) uses [node:title] for the page title. Unfortunately, Exclude Node Title hides this so the page title ends up blank. It is recommended to <a href="admin/config/search/metatags">change the "title" field's default value</a> to "[current-page:title]" instead of "[node:title]" for any content types affected by Exclude Node Title.

Is this statement still accurate with the latest changes you've made?

fizk’s picture

@DamienMcKenna, that statement should be removed when ENT 7.x-1.7 is released. I'll create an issue in Metatag to give you a heads up.

I'd like to hear some feedback if dev works properly or has any bugs before releasing v1.7.

CatherineOmega’s picture

This looks like it's working properly to me.

fizk’s picture

I probably waited too long... :) but ENT 7.x-1.7 has just been released.