If views taxonomy term page is enabled you'll get this notice:
Notice: Undefined variable: page_language in taxonomy_field_menu_translated_menu_link_alter() (line 1342 of .../taxonomy_field_menu.module).

Here's a patch to solve this issue.

and thanks for your module.

Comments

anou’s picture

StatusFileSize
new1.04 KB
anou’s picture

StatusFileSize
new1.04 KB

Oups wrong extension... sorry

smiletrl’s picture

Status: Active » Needs review

Thanks for posting patches for this module, anou!

Generally speaking, we need to change issue status to 'Needs review', so drupal bot will take your patch for review:)

smiletrl’s picture

Thanks anou. This is indeed a bug. This problem comes because the menu callback has been altered for term.

Your patch works well for the views case. But if menu callback for node/%, or taxonomy/term/% has been altered in other way, this problem may still remain.

So my suggestion is, besides your change, maybe we can change this code too.

    // Check active interface language.
    else {
      global $language;
      if ($path0 == 'admin') {
        // Always show links in admin pages.
        $page_language = 'und';
      }
      else {
        $page_language = $language->language;
      }
    }

to

    // Check active interface language.
    else {
      if ($path0 == 'admin') {
        // Always show links in admin pages.
        $page_language = 'und';
      }
    }

    if (!isset($page_language)) {
      global $language;
      $page_language = $language->language;
    }
anou’s picture

And another thing about language, it´s better to use 'LANGUAGE_NONE' instead of 'und'.
And next time, I'll change the status ;-)
Thanks for the advice.

anou’s picture

Title: Notice: Undefined variable: page_language if taxonomt term view is enabled » Notice: Undefined variable: page_language if taxonomy term view is enabled
smiletrl’s picture

Priority: Normal » Critical
Status: Needs review » Needs work

Great, when these parts are finished, I will add you to the maintainer list of this module, so you can commit these changes:)

anou’s picture

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

Hello,
Here's a patch for all the changes :

  1. If views taxonomy term is enable
  2. change 'und' by LANGUAGE_NONE
  3. make $page_language always set

And you don't need to make me a maintainer, but I sure be happy if you authored this patch on me :-)
Have a nice shiny day !

smiletrl’s picture

Status: Needs review » Closed (fixed)

Thanks anou! I have authored you for this patch. This commit message has displayed at your profile now.

There's a small trailing whitespace in this patch though, -- I have removed it. If you want to check this trailing space issue manually, I recommend https://dreditor.org/. After install this editor, you will see the extra space when you review this patch.

Thanks again!

jeff.a’s picture

Status: Closed (fixed) » Needs review

Could anyone tell me the status of patch #8? Tried it with 7.x-1.0 and 7.x-1.x-dev with no luck. The errors are still present. Issues applying the patch as well.

I'm getting:
Notice: Undefined variable: page_language in taxonomy_field_menu_translated_menu_link_alter() (line 1341 of ...sites/all/modules/taxonomy_field_menu/taxonomy_field_menu.module).

Reverted back to 7.x-1.0-beta1 and the errors are gone. Don't really need language support for now. Thanks.

anou’s picture

Status: Needs review » Closed (fixed)

Patch was committed to dev version. See here

jeff.a’s picture

That's bizarre. I could have sworn the dev version was still throwing the error after clearing all caches, which is why I tried to patch it. Appears to be working now. Thank you for clearing that up.

lan’s picture

Thanks so much for the module and the patch!
But I have got another notice:
Notice: Undefined property: stdClass::$language in taxonomy_field_menu_translated_menu_link_alter() (line 1330 of modules\taxonomy_field_menu\taxonomy_field_menu.module).

Please help. Thanks.

smiletrl’s picture

Lan, what's your drupal version and where/when do you see this notice?

smiletrl’s picture

Also, did you enable views page "taxonomy/term/% view"?

lan’s picture

Thanks for your response smiletrl. I am using drupal 7.32, it s on my taxonomy term views page. actually it happens on the taxonomy/term/% views page.

lan’s picture

smiletrl , have you got any idea about this notice yet? Thanks.

smiletrl’s picture

Thanks Lan!

This is actually a bug for drupal 7.32. This latest version has removed language property from term object.

I just committed the fix. Let me know if this issue remains.

lan’s picture

Thanks smiletrl. sorry, how to fix it?

smiletrl’s picture

Download dev version of this module. The dev version always has the latest code.

lan’s picture

I see , thanks :)

lan’s picture

It works. thanks so much smiletrl.

smiletrl’s picture

cool:)