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

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

jmarkel created an issue. See original summary.

jcnventura’s picture

Status: Active » Reviewed & tested by the community
joseph.olstad’s picture

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

solideogloria’s picture

Version: 3.0.0-alpha2 » 3.x-dev
bbu23’s picture

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.

joseph.olstad’s picture

@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 most likely didn't look at the code in the merge request and your last comment is totally out of context.

bbu23’s picture

@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.

And marking my comment as spam just because you disagree or don't understand my point is bm and uncalled for.

solideogloria’s picture

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

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

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

joseph.olstad’s picture

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.x version of openid_connect in Drupal 10,

solideogloria’s picture

MR needs to be changed to use hook_update_N

dressedk made their first commit to this issue’s fork.

dressedk’s picture

As suggested by others in this thread, I have created a new issue fork and added a new hook_update_N for adding the missing "iss_allowed_domains".

dressedk’s picture

Status: Needs work » Needs review

pfrilling made their first commit to this issue’s fork.

pfrilling’s picture

I closed MR #86 in favor of MR #143. I added an update test to confirm the changes. If someone wants to review and mark this RTBC, I'll get it merged.

pfrilling’s picture

Assigned: Unassigned » pfrilling
Status: Needs review » Needs work

I'm marking this needs work to fix the update hook as it conflicts with the update hook introduced in #3375886: Warning: Undefined array key "iss_allowed_domains".

pfrilling’s picture

Assigned: pfrilling » Unassigned
Status: Needs work » Needs review

The rebase has been completed. Marking this needs review.

solideogloria’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

pfrilling’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone! The merge train has begun.

Status: Fixed » Closed (fixed)

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