upadted to 1.8

This commit is contained in:
Bachir Soussi Chiadmi
2013-09-26 15:49:26 +02:00
parent e0ae80791b
commit 128640cd15
52 changed files with 2604 additions and 1015 deletions

View File

@@ -11,14 +11,16 @@ class SearchApiAlterAddViewedEntity extends SearchApiAbstractAlterCallback {
* @see SearchApiAlterCallbackInterface::supportsIndex()
*/
public function supportsIndex(SearchApiIndex $index) {
return (bool) entity_get_info($index->item_type);
return (bool) $index->getEntityType();
}
public function configurationForm() {
$info = entity_get_info($this->index->item_type);
$view_modes = array();
foreach ($info['view modes'] as $key => $mode) {
$view_modes[$key] = $mode['label'];
if ($entity_type = $this->index->getEntityType()) {
$info = entity_get_info($entity_type);
foreach ($info['view modes'] as $key => $mode) {
$view_modes[$key] = $mode['label'];
}
}
$this->options += array('mode' => reset($view_modes));
if (count($view_modes) > 1) {
@@ -60,7 +62,7 @@ class SearchApiAlterAddViewedEntity extends SearchApiAbstractAlterCallback {
$original_user = $GLOBALS['user'];
$GLOBALS['user'] = drupal_anonymous_user();
$type = $this->index->item_type;
$type = $this->index->getEntityType();
$mode = empty($this->options['mode']) ? 'full' : $this->options['mode'];
foreach ($items as $id => &$item) {
// Since we can't really know what happens in entity_view() and render(),