There is an issue in the 7.x version related with the index of documents.
In watchdog, when we try to index queued content we get:

Notice: Undefined property: stdClass::$language in apachesolr_multilingual_apachesolr_index_documents_alter() (line 95 of (...)/apachesolr_multilingual/apachesolr_multilingual.module).

I think the problem is the way that is used to get the entity language. The module should use entity_language function instead of trying to get the language from entity as an object.

Comments

mkalkbrenner’s picture

Status: Active » Postponed

The expression that causes the Warning is
(LANGUAGE_NONE == $document->ss_language && LANGUAGE_NONE == $entity->language)

The documentation of function entity_language() says that it will return NULL instead of LANGUAGE_NONE.
But there're entities having LANGUAGE_NONE as value.

So this fix is not a quick fix but requires some more research.

joachim’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Postponed » Needs review
StatusFileSize
new812 bytes

I don't think it's actually all that complicated. Yes, the return value of entity_language() is odd.

However, what the code here in apachesolr_multilingual_apachesolr_index_documents_alter() is actually doing is trying to determine whether the entity is language-neutral or not:

      if (LANGUAGE_NONE == $document->ss_language && LANGUAGE_NONE == $entity->language) {
        // language-neutral

For our purposes, both a NULL language and LANGUAGE_NONE neutral.

Here's a patch.

There are other language key issues that I'll file separately.

joachim’s picture

Title: Undefined property: stdClass::$language » Undefined property: stdClass::$language in apachesolr_multilingual_apachesolr_index_documents_alter()
stefan.r’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks great and fixes the issue