This can't be a bug or other people would be reporting it. But does anyone have any thoughts on what might be happening?

A consent form is created, and a field referencing it added to the user account fields. It is showing when creating a new user as an admin. When registering one's own account, as an anonymous user, it however displays no text, field, or checkbox and gives an error when submitting the form. Inspection of the HTML reveals this empty, if class and ID heavy, div:

<div class="field--type-gdpr-user-consent field--name-field-consent field--widget-gdpr-consent-widget js-form-wrapper form-wrapper" data-drupal-selector="edit-field-consent-wrapper" id="edit-field-consent-wrapper"></div>

And the error when submitting:

This value should not be null.

All the templates are from Drupal core's 'stable' theme directly; no overrides on the user registration form or for any form elements.

I've enabled any potentially related GDPR permissions, and confirmed there's no field permissions module installed.

I've triple-checked that the GDPR Consent field is in the displayed section of Manage Form Display and Manage Display of user accounts, and there are no custom display settings.

And, of course, i've cleared caches 150 times.

Any ideas?

Comments

mlncn created an issue. See original summary.

Balu Ertl’s picture

Hi Benjamin, your issue is set to 8.x-2.x-dev, which is only kept as kind of placeholder for the future port of Drush 9.

However, AFAIK the spearhead of the current development more happens on the 8.x-1.x branch instead. Do you experience the same with this dev version, please?

mlncn’s picture

Version: 8.x-2.x-dev » 8.x-1.0-alpha11

Sorry this was actually with alpha11

voleger’s picture

voleger’s picture

This #2980349: [GDPR Consent] Fix resolving of user id for new users also will be related because even the field widget will be correctly rendered, the user ID recognition will detect NULL (but not correct ID of registered user)

voleger’s picture

Version: 8.x-1.0-alpha11 » 8.x-1.x-dev
Balu Ertl’s picture

Assigned: Unassigned » Kosa Ilma
Issue summary: View changes

Ilma, could you please test it with the latest 1.x dev version to see if we can still reproduce the situation (empty div rendered on user/register form)?

Kosa Ilma’s picture

Patch from the issue: https://www.drupal.org/project/gdpr/issues/2980119 has been added, that should solve this.

Kosa Ilma’s picture

Status: Active » Fixed
Balu Ertl’s picture

Balu Ertl’s picture

Status: Fixed » Closed (fixed)

Moving issue state manually from Fixed 🠂 to Closed (fixed) in the hope that issue queue gets cleaner a bit.