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.

Comments

Daniel Korte created an issue. See original summary.

daniel korte’s picture

Assigned: daniel korte » Unassigned
Status: Active » Needs review
StatusFileSize
new505 bytes
damienmckenna’s picture

What 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.

daniel korte’s picture

I'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.

damienmckenna’s picture

Oh. I didn't realize that the textarea field supported a maxlength attribute X-)

So yeah, that'd work, thank you.

mayaslatinek’s picture

I had the same issue on 8.x-1.11. Patch from #2 fixed it.

bygeoffthompson’s picture

StatusFileSize
new18.18 KB
new17.89 KB

This 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.

Thanks

This should be its own issue independent of this. I have tested the Description field issue and can confirm Patch #2 works great.

Thanks!

bygeoffthompson’s picture

Boy 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.

A brief and concise summary of the page's content, preferably 320 characters or less.

needs to change to:

A brief and concise summary of the page's content that is 320 characters or less.

By setting a maxlength this is no longer just preferable. It is a requirement.

New patch attached.

Thank you.

mrshowerman’s picture

#8 works for us.

bryandenijs’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Thanks for the patch! #8 works great!

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you all.

Status: Fixed » Closed (fixed)

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

nikhilesh gupta’s picture

StatusFileSize
new1.13 KB
nikhilesh gupta’s picture

StatusFileSize
new1.16 KB
vj2150’s picture

This 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.

damienmckenna’s picture

@vj2150: Please open a new issue for that and we can discuss it.

jlongbottom’s picture

StatusFileSize
new1.13 KB

Would be nice to make this configurable. My team would like a max of 380, so here is my patch, modified from #14. Thanks.

damienmckenna’s picture

dealancer’s picture

patch #18 works ok, i have reviewed it, please change status of this issue

guardiola86’s picture

Was the patch in #8 removed? I can't find the changes on the latest version.