I'm using Entity Translation with :

English set as default language at admin/config/regional/language

In the User Alert content type the "Multilingual support " is disabled.

So this code is setting language to 'und' but in my case it is actually to be 'en'

function user_alert_display_alert() {
  if (module_exists('translation')) {
    global $language;
    $language = $language->language;
  } else {
    $language = LANGUAGE_NONE;  //in my case I've temporarily set to en
  }

Ideally it should query all the User Alerts without language in the db_query.

Comments

rag_gupta created an issue.

gromani14’s picture

Hi rag_gupta,
I have the same issue and i've fixed wreplacing the query with the following one.. this will allow content with language setted or not.

	$result = db_query("SELECT n.nid FROM {node} n WHERE type = :type AND status = :status AND "
      . "(language = :language OR language = 'und') AND n.nid NOT IN "
      . "(SELECT ua.nid FROM {user_alert} ua WHERE ua.nid = n.nid AND ua.uuid = :cookie) ORDER BY nid DESC",
      array(':type' => 'user_alert', ':status' => NODE_PUBLISHED,  ':language' => $language, ':cookie' => $_COOKIE['UUID']));