Warning: Undefined array key "iss_allowed_domains"

Created on 20 July 2023, 11 months ago
Updated 18 March 2024, 3 months ago

Problem/Motivation

Editing the edit form for an existing openid-connect generic client causes a warning message

The issue is present both in 3.0-alpha2 and 3.x

Steps to reproduce

Edit an existing generic client configuration form

Proposed resolution

Update the code to properly verify that iss_allowed_domains exists in the configuration array before attempting to use it, and use an empty string instead if it does not.

Remaining tasks

  • Create issue fork
  • Create issue branch
  • Add fix to issue branch
  • Create merge request

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jmarkel

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

Comments & Activities

  • Issue created by @jmarkel
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update 11 months ago
    100 pass
  • @jmarkel opened merge request.
  • Status changed to RTBC 11 months ago
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Yes I need this also , running PHP 8.1 with the 3x branch.

  • πŸ‡·πŸ‡΄Romania bbu23

    In my opinion, this is a mistake at the update_Ns level where the existing configuration does not get this key set. For new configuration entities, the key will always be there. The code is supposed to work for all cases, so if no update hook is provided to fix this, I'd rather just resave the existing converted configuration and that will fix the warning.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    @bbu23 , sorry but it looks like your account has been hacked, so I marked your comment as spam. I don't usually do this but your comment shows that you didn't look at the code and is totally out of context.

  • πŸ‡·πŸ‡΄Romania bbu23

    @joseph.olstad I don't appreciate that accusation and your answer. I most definitely checked the MR, locally tested and I am very confident that the change is not necessary. The "iss_allowed_domains" setting is added later to the base configuration and all existing config entities are affected by that until they are saved once. This is because no update_N hooks are covering it. A configuration form like that is not supposed to have an isset scenario because the default values exist in the schema. This change is still unnecessary in my opinion. Plus that MR covers only the form. The rest of the code is supposed to get that as an empty string anyways if nothing special is set.

  • I agree with her. Not spam, and definitely something that could be fixed with an update hook. It's completely relevant.

  • Status changed to Needs work 8 months ago
  • πŸ‡΅πŸ‡ΉPortugal jcnventura

    Indeed, let's fix this better with a hook_update..

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Sorry @bbu23, my mistake, I seriously thought you were some chat GPT bot but I see that you are real.

    I've come accross this situation again with the 3.0.x version of openid_connect in Drupal 10,

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update 8 months ago
    100 pass
  • MR needs to be changed to use hook_update_N

Production build 0.69.0 2024