Commit 604a065b authored by 30equals's avatar 30equals Committed by Spleshka

Issue #2271613 by 30equals, Spleshka: Fatal Error: Call to undefined function entity_language()

parent caa956ed
......@@ -57,7 +57,21 @@ class ExpireAPI {
// Define object languge. It will be used to define path aliases.
$language = NULL;
if (!empty($object_type) && !empty($object)) {
$language = entity_language($object_type, $object);
if(function_exists('entity_language')){
$language = entity_language($object_type, $object);
}
else{
$info = entity_get_info($object_type);
if (isset($info['language callback']) && function_exists($info['language callback'])) {
$language = $info['language callback']($object_type, $object);
}
elseif (!empty($info['entity keys']['language']) && isset($object->{$info['entity keys']['language']})) {
$language = $object->{$info['entity keys']['language']};
}
else {
$language = NULL;
}
}
}
// Adds paths aliases, defines wildcards, etc.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment