I just upgraded to Drupal 7.15 and the latest -dev version of this module, and now many of my pages return this error:

Notice: Undefined index: field_name in title_field_views_data_alter() (line 12 of /<MYSITE>/sites/all/modules/title/views/title.views.inc).

I've run update.php, which doesn't fix the issue.

Oddly though, a page refresh seems to eliminate the errors, but flushing the cache explicitly re-triggers it.

Any thoughts on how to fix this?

Comments

peximo’s picture

Assigned: Unassigned » peximo
Status: Active » Postponed (maintainer needs more info)

Hi, could you provide additional information (E.g. the replaced field configuration)?
I can't replicate the error.

brycesenz’s picture

Can you elaborate on what specifically you need?

I have a multilingual site set up with Entity Translation, and am using the Title module to support that translation. I also show the titles through the Views and Panels modules on most pages.

peximo’s picture

With a clean installation of Drupal 7.15, Entity Translation 7.x-1.0-alpha2 and Title 7.x-1.0-alpha4 I can not reproduce the bug.
Can you add debug($replacements); in title_field_views_data_alter() under $replacements = title_field_replacement_info($ entity_type); (in title.views.inc) and post the output?

FranciscoLuz’s picture

Status: Postponed (maintainer needs more info) » Active

Entiry Translation ( http://drupal.org/project/entity_translation ) is the culprit. Once you enable it you will start getting the notice message every time you enable or disable a module and when flushing the cache.

The notice goes away after disabling the Entity Translation module.

FranciscoLuz’s picture

Status: Active » Fixed

I've just updated both modules, Title to 7.x-1.x-dev 2012-Sep-16 and Entity Translation to 7.x-1.x-dev 2012-Sep-19, and it has apparently fixed it.

If anyone is still having this issue, please change the status back to active.

brycesenz’s picture

Just confirming that the solution worked for me.

Status: Fixed » Closed (fixed)

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

ndobromirov’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
StatusFileSize
new1.23 KB

Added a defensive check that will prevent the notices for misbehaving entity types.

plach’s picture

Status: Needs review » Needs work

Looks good, but please could you use "positive" if conditions? Using the continue statement makes the code harder to follow.

ndobromirov’s picture

Status: Needs work » Needs review
StatusFileSize
new1.01 KB

Uploading new patch with the requested change.

Note:
I've added the continue statements as there was too much indentation already and I was going to add one more on top of it.

plach’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

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

  • Commit 32e8016 on 7.x-1.x, workbench authored by ndobromirov, committed by plach:
    Issue #1779268 by ndobromirov | brycesenz: Undefined index: field_name...