Closed (fixed)
Project:
Profile
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2024 at 17:21 UTC
Updated:
21 Apr 2024 at 13:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jsacksick commentedAre you using the contextual filter introduced in the latest release? From issue #2835930: Provide Views argument for current user's profile ID?
Downgrading the priority to "major" as it doesn't render your site unusable afaik: https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-...
Comment #3
mkalkbrennerNo, it happens with the current store and our own contextual filters. So it seems that this new contextual filter modifies all the forms somehow.
And https://git.drupalcode.org/project/profile/-/commit/457170d860ab4aa6d3b3... seems related.
BTW for us it is critical as we need to adjust all our views with contextual filters and that can't be done by the site administrators.
Comment #4
jsacksick commentedhm... Extremely weird that the setting applies to all contextual filters... So you're saying just the "#required" attribute is causing this? WIthout the #required flag everything works ok?
Comment #5
mkalkbrennerThis patch solves the issue for us. It seems that you have to set the required flag only if this default argument is really selected. Or handle it in the form validation.
Comment #6
jsacksick commentedI didn't test that change I must admit, I was pinged by somebody from my team who reviewed the contextual filter and was surprised to see the setting not required as the contextual filter cannot work without the #required attribute.
Comment #7
poker10 commented@jsacksick I can confirm this issue as well (as I have also reported here #2835930: Provide Views argument for current user's profile ID). The #required attribute is the problem. The filter seems to be rendered even if not selected and thus the #required attribute prevents the possibility to save all contextual filters (therefore I think this is pretty major). Removing the #required attribute solved the problem for us.
I do not see any other class extending
ArgumentDefaultPluginBasewith #required attribute inbuildOptionsForm(). If we want to require it, maybe we can use#statesinstead, or check it in the validation, as proposed in #5. Thanks for looking at this!Comment #9
jsacksick commentedCommitted the change, thanks! Will tag a new release with the fix.
Comment #10
geek-merlinFTR: If this causes regressions, i guess the #states voodoo needs to care for #required too.
Comment #12
cayenne commentedI just updated to the latest version (10.2.5) and I am still experiencing this bug
Simple view of nodes, add a contextual filter by ID fails, with the dreaded "The submitted value in the Profile type element is not allowed." problem.
Comment #13
poker10 commented@Cayenne Have you updated the Profile module to 8.x-1.10 as well? This was a bug in the Profile module, not in Drupal core.