When building the renderable array rendering the renderable array of the address field in AddressDefaultFormatter::viewElement there are array elements of using '#type'=>'value' , which are FormElements (as opposed to RenderElements). This is causing undesirable behavior in the Read-only field widget module and causing it to delete field data for address fields because the values in the form elements end up in the form_state data.

I've marked this as a Feature Request because it's probably not causing any problems in this module in isolation, but it would be nice if it worked slightly differently.

CommentFileSizeAuthor
#2 2961594-2.patch1.71 KBthtas

Comments

thtas created an issue. See original summary.

thtas’s picture

StatusFileSize
new1.71 KB

Patch attached

thtas’s picture

Issue summary: View changes
bojanz’s picture

Title: Form render elements in view formatter » Don't use form render elements in the formatters
Version: 8.x-1.3 » 8.x-1.x-dev
Category: Feature request » Bug report
Priority: Minor » Normal
Status: Active » Needs review

Thanks! We're definitely using the API wrong.

  • bojanz committed f965e89 on 8.x-1.x authored by thtas
    Issue #2961594 by thtas, bojanz: Don't use form render elements in the...
bojanz’s picture

Status: Needs review » Fixed

Committed! Removed $element['country_code'] complete cause it seems unused.

Status: Fixed » Closed (fixed)

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