Incorrect assumption of user form having uid field

Created on 26 September 2022, over 2 years ago
Updated 20 November 2023, over 1 year ago

Problem/Motivation

The simplesamlphp_auth_user_form_submit function incorrectly assumes that the user form would always have the uid field which is not necessary if custom user form mode is used somewhere on the site.

This causes WSOD in the following code since NULL is passed to $authmap->delete() instead of expected int.

  // Remove this user from the ExternalAuth authmap table.
  else {
    $authmap->delete($form_state->getValue('uid'));
  }

Steps to reproduce

Create a custom user form mode, open it and submit the form.

Expected: the form submits.
Actual: WSOD.

Proposed resolution

Retrieve uid from the user account entity stored in the form instead.

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024