backdrop-contrib / webform_registration

Allow Webforms to register users
GNU General Public License v2.0
0 stars 2 forks source link

[PHP8.1] Fatal error when saving a webform that doesn't map a user's term reference. #7

Open argiepiano opened 1 year ago

argiepiano commented 1 year ago

When you save a Webform that doesn't contain a webform component mapping to an existing user's term reference field you get the following errors in PHP 7.4 (which are fatal in PHP 8.1)

Screen Shot 2023-07-10 at 8 57 21 AM

This may also be an issue with other types of fields, but I haven't tested for that.

argiepiano commented 1 year ago

PR #8

argiepiano commented 1 year ago

EDIT: While this fix is harmless and could be a good preventative measure, we have discovered that the node entity cache was in fact producing the problem above. The issue (which is mentioned in #6) is that the node entity cache is not flushed upon saving the webfom_registration settings at node/XX/webform/registration, and therefore the site keeps using a stale version of the webform node that doesn't contain the mappings for the user Field API fields.