Problem/Motivation
The Basic Description field description was changed to recommend 320 characters or less, but the field inherits the base form with a maxlength of 255.
Also, I am not sure how exactly this happened, but I had a user enter exactly 320 characters which broke the node edit page. The page had some Paragraphs fields which use AJAX, but the fields wouldn’t work with the Basic Description field filled in with 320 characters and a maxlength set of 255 characters. When clicking to add/edit a Paragraph AJAX would return the Paragraphs response, but then also an error message response for the Basic Description field which actually wouldn’t end up rendering anything new at all on the page for whatever reason.
Proposed resolution
Change the Basic Description field to have a maxlength of 320.

| Comment | File | Size | Author |
|---|---|---|---|
| #18 | increase-meta-length-3106609-18.patch.txt | 1.13 KB | jlongbottom |
| #15 | increase-meta-length-3106609-15.patch | 1.16 KB | nikhilesh gupta |
| #8 | limit-description-field-and-update-instructions-3106609-8.patch | 1.16 KB | bygeoffthompson |
| #7 | afterPatch.jpg | 17.89 KB | bygeoffthompson |
| #7 | beforePatch.jpg | 18.18 KB | bygeoffthompson |
Comments
Comment #2
daniel korteComment #3
damienmckennaWhat version of the module are you using? This shouldn't happen since 8.x-1.11 (thanks to #3001387: Extend meta tag definition to allow some tags to use a textarea instead of text field, e.g. og:description) where some tags were changed to using a textarea instead of a textfield.
Comment #4
daniel korteI'm using the latest release, 8.x-1.11. That issue leaves
'#maxlength' => 255,in place on the textarea. This issue solves the maxlength HTML attribute issue which that issue does not address.Comment #5
damienmckennaOh. I didn't realize that the textarea field supported a maxlength attribute X-)
So yeah, that'd work, thank you.
Comment #6
mayaslatinek commentedI had the same issue on 8.x-1.11. Patch from #2 fixed it.
Comment #7
bygeoffthompson commentedThis is not quite complete based on my tests.I have encountered this issue after a deployment yesterday. Applying Patch #2 resolves the Description field issue (properly limited to < 320 chars) but other fields, such as Abstract, are still limited to < 255 chars (despite metatag UI stating only up to 150 chars is acceptable).Errors before patch (beforePatch.jpg):Description cannot be longer than 255 characters but is currently 490 characters long.Abstract cannot be longer than 255 characters but is currently 490 characters long.Errors after patch (afterPatch.jpg):Description cannot be longer than 320 characters but is currently 490 characters long.Abstract cannot be longer than 255 characters but is currently 490 characters long.Error message re: Abstract field should say: Abstract cannot be longer than 150 characters but is currently [count] characters long.I am working on updating Patch #2 to account for this.ThanksThis should be its own issue independent of this. I have tested the Description field issue and can confirm Patch #2 works great.
Thanks!
Comment #8
bygeoffthompson commentedBoy I'm all over here today :)
Patch #2 works but with a hard limit on the Description field of 320 chars we also need to update the field UI's instruction to reflect this change.
needs to change to:
By setting a maxlength this is no longer just preferable. It is a requirement.
New patch attached.
Thank you.
Comment #9
mrshowerman#8 works for us.
Comment #10
bryandenijsThanks for the patch! #8 works great!
Comment #12
damienmckennaCommitted. Thank you all.
Comment #14
nikhilesh gupta commentedComment #15
nikhilesh gupta commentedComment #16
vj2150 commentedThis happens with Image and Image URL fields (under Open Graph) too.
Administration -> Configuration -> Search and metadata -> Metatag -> Content -> Edit -> Open Graph -> Image.
Can choose multiple images from the Browse available tokens. However can't save more than 255 characters.
Comment #17
damienmckenna@vj2150: Please open a new issue for that and we can discuss it.
Comment #18
jlongbottom commentedWould be nice to make this configurable. My team would like a max of 380, so here is my patch, modified from #14. Thanks.
Comment #19
damienmckennaYou should also try collaborating on #2958193: Automatically trim meta tag lengths (D9).
Comment #20
dealancer commentedpatch #18 works ok, i have reviewed it, please change status of this issue
Comment #21
guardiola86 commentedWas the patch in #8 removed? I can't find the changes on the latest version.