Problem/Motivation

When you are an authenticated user, but the tabs are not available (because they don't have the permission or whatever).

The javascript throws an error:
Uncaught TypeError: Cannot set property 'onclick' of null

Steps to reproduce

Log in as user without permission (or go to a route in frontend without tabs)

Proposed resolution

Check if the javascript variable is not null before adding onclick to it.

CommentFileSizeAuthor
#2 check-variable-in-js-3218015-2.patch640 bytesmheip
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

mheip created an issue. See original summary.

mheip’s picture

StatusFileSize
new640 bytes

Adding patch that sets a variable and checks if it exists.

mheip’s picture

Status: Active » Needs review

Changing to needs review

jeroent’s picture

Status: Needs review » Reviewed & tested by the community

Dennis Cohn made their first commit to this issue’s fork.

  • Dennis Cohn committed 4bca107 on 1.0.x
    Issue #3218015: Javascript throws error when tabs are not available
    
dennis cohn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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