Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The getter/setter methods generated for normal (not long) text fields uses the getText() and setText() methods. But I believe what is needed there is the normal get() and set(), since EntityDrupalWrapper expects a string for the value of these. I'm attaching a patch that seems to fix it for me (though I may be missing some steps.)
Comment | File | Size | Author |
---|---|---|---|
#4 | 2468965-4-fix-broken-setText-method.patch | 881 bytes | zengenuity |
#1 | 2468965-1-wrappers_delight-normal_text_getter_setter.patch | 1.08 KB | brockfanning |
Comments
Comment #1
brockfanning CreditAttribution: brockfanning commentedComment #2
zengenuity CreditAttribution: zengenuity commentedI need to run some tests, but I know that normal text fields can support formatted text. There's some code inside setText() that is supposed to work that out from the field config, and then decide if it's plain text only or not. Perhaps that code doesn't work correctly. Do the exceptions go away if you switch that field into formatted mode under the field config?
Comment #3
brockfanning CreditAttribution: brockfanning commentedAha, yes, if I change the field configuration from "Plain text" to "Filtered text" then the exception go away.
Comment #4
zengenuity CreditAttribution: zengenuity commentedOkay, I had left a test field name in the setText() function instead of checking the actual field name being called. Please test it with this patch and using the Plain Text option on the field like you had initially.
Comment #5
brockfanning CreditAttribution: brockfanning commentedJust tested this, that fixed the issue for me, thanks!
Comment #7
zengenuity CreditAttribution: zengenuity commented