If facets module is enabled, and if you set in admin/config/regional/language/detection the option 'Session' as your detection language method, the site will crash with following error:

Error: Call to a member function getId() on null in facets_language_switch_links_alter() (line 373 of ... web/modules/contrib/facets/facets.module

Code assumes that

$link['language']

contains an object, but the object is missing.
This happened with core 8.5.1 and facets 1.0-beta2.
The weight of the language detection does not affect, so you just need to select the 'Session' option.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eldrupalista created an issue. See original summary.

borisson_’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev
Issue tags: -crash, -language detection, -session
FileSize
1001 bytes

I'm assuming this also happens on the latest dev version, so changing version. I can't seem to reproduce this though. I did attach a patch that in theory should resolve this, but as I can't reproduce this - I'm going to need more information on when this happens

PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.

eldrupalista’s picture

Thank you, that solved the problem.

borisson_’s picture

Status: Active » Needs review

Setting to needs review to have the testbot test this as well.

Status: Needs review » Needs work

The last submitted patch, 2: 2959215.patch, failed testing. View results

borisson_’s picture

Status: Needs work » Needs review
FileSize
1.25 KB
969 bytes

Now passes tests as well.

  • borisson_ committed 5d80b8b on 8.x-1.x
    Issue #2959215 by borisson_: Site crash if language detector method '...
borisson_’s picture

Status: Needs review » Fixed
Issue tags: +DUGBE

Fixed, based on @andreasderijcke's feedback at drupal belgium's sprint day.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

VitaliyB98’s picture

Just re-patch for beta-2

VitaliyB98’s picture