This wasn't working for me on a site that we've inherited, as the node language conditions in _node_display_title_get_display_title() were failing.

The easiest and cleanest way that I could get this to work is to add a dependency on the entity module and delegate that check to the entity_metadata_wrapper() function.

I propose that the module be updated to use this method. Patch to follow shortly.

Comments

opdavies created an issue. See original summary.

opdavies’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

This patch adds the dependency to node_display_title.info, and updates the _node_display_title_get_display_title() logic as described in the issue description.

begun’s picture

Thanks for putting together this patch. In the interest of keeping the module as light as possible I would prefer to avoid adding extra module dependencies if possible. Wondering if same thing might be achieved with field_get_items() and possibly field_view_value().

I am keen to know more about the cause of the issue. Do you have any debugging related information you could share? Wondering if this is a language code related issue or something else.

begun’s picture

Status: Needs review » Postponed (maintainer needs more info)
opdavies’s picture

I have an updated patch. I'll upload it most likely tomorrow when I'm back in the office. :)

opdavies’s picture

Title: Not working for me, propose a switch to use entity_metadata_wrapper » Not working for me
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new854 bytes
new1.2 KB

Here is the updated patch that removes the dependency on the entity module, and instead uses field_get_items() and field_view_value().

kiwimind’s picture

Having spoken with Ollie, he's going to rework the patch to simplify it, especially removing the ternary from the return and removing the use of the $title variable as it's no longer needed.

Happy to take another glance once the new patch is there.

Current patch applies cleanly to 7.x-1.x.

opdavies’s picture

StatusFileSize
new822 bytes
new631 bytes
kiwimind’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies cleanly to 7.x-1.x.

Looks good to me, think this reads better.

opdavies’s picture

Looks good to me, think this reads better.

Agreed.

begun’s picture

Thanks @opdavies for putting together this patch. I can't see there being any issue with the patch given that using field_get_items() and field_view_value() methods are a good, safe way of obtaining the display value of a field; however, it would be good to know how to recreate the particular issue you encountered. Would be grateful if you could provide me with some additional info around this. You mentioned language related issues. Was this by chance a multi language site?

begun’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
kiwimind’s picture

Title: Not working for me » Node language conditions failing in _node_display_title_get_display_title()
astonvictor’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.