Sometimes nodepicker urls will randomly contain a language prefix. We have multiple languages and I have been able to get translations working for the most part. Have you seen any kind of issues come up w/nodepicker + languages + caching?

When I clear the cache it works again, so I'm guessing it's some kind of edge case occurring from those 3 things combined.

Comments

drupalninja99’s picture

I believe the issue if the link gets cached on a neutral language page while the user has switched their language.

drupalninja99’s picture

What we have to do is nodepicker_render_tag or nodepicker_decode_tag has to make sure not to return a prefixed version of the link if it gets called with you on /it/, /es/, etc of a neutral page. otherwise when you return back to english or another language that prefix is always in the filter cache when there should be none.

drupalninja99’s picture

//force that we get the original path bc drupal_get_path_alias/drupal_lookup_path() forces the user's current language
  $path = db_result(db_query('SELECT dst FROM {url_alias} WHERE src = "%s"', $attr['href']));

  if (!$path)
    $path = $attr['href'];//just use non-aliased

  $link = l($attr['link_text'], $path, array('language' => '', 'attributes' => array('title' => $attr['title'], 'class' => 'nodepicker-link'), 'html' => TRUE));

The solution I believe is to force the path to be the one in the nodes original language no matter the users current language when this processing occurs.

peter törnstrand’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)