Problem/Motivation

In some cases the LimitLanguageOptionsCallback.php may throw:

The website encountered an unexpected error. Please try again later.
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 55 of modules/contrib/language_access/src/LimitLanguageOptionsCallback.php).

Steps to reproduce

- hard to say, but was able to trigger the problem on my configuration

Proposed resolution

- patch

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Piotr Pakulski created an issue. See original summary.

piotr pakulski’s picture

StatusFileSize
new1.23 KB

Prepared patch for this issue

piotr pakulski’s picture

Status: Active » Needs review
piotr pakulski’s picture

Assigned: piotr pakulski » Unassigned
jeroent’s picture

Status: Needs review » Needs work
src/LimitLanguageOptionsCallback.php ✗ 10 more
line 54	Line indented incorrectly; expected 4 spaces, found 6
55	Line indented incorrectly; expected 4 spaces, found 6
56	Line indented incorrectly; expected 6 spaces, found 10
57	Line indented incorrectly; expected 8 spaces, found 14
58	Line indented incorrectly; expected 10 spaces, found 18
59	Line indented incorrectly; expected 8 spaces, found 14
60	Line indented incorrectly; expected 6 spaces, found 10
61	Line indented incorrectly; expected 4 spaces, found 6
62	Line indented incorrectly; expected 4 spaces, found 6
63	Line indented incorrectly; expected 4 spaces, found 6
mohd sahzad’s picture

Assigned: Unassigned » mohd sahzad
mohd sahzad’s picture

Assigned: mohd sahzad » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.03 KB

I have updated this issue in above attached patch4

  • jeroent committed 929a2724 on 2.0.x
    feat: #3391364 Argument #1 ($array) must be of type array, null given...
jeroent’s picture

Status: Needs review » Fixed

Merged to 2.0.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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

piotr pakulski’s picture

I can still see:
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 59 of /var/www/html/docroot/modules/contrib/language_access/src/LimitLanguageOptionsCallback.php).

on version 2.0.2

piotr pakulski’s picture

MR17 does not seems to cover afterBuild() method. It's still fragile.