In the metatag UI the "Abstract" field instructions state:
"A brief and concise summary of the page's content, preferably 150 characters or less."
As of update to 8.x-1.11 the following error is printed when Abstract field is > 255 chars:
"Abstract cannot be longer than 255 characters but is currently [count] characters long."
This error is present because until recently metatag module did not restrict how long Abstract field was. In my client's case (from where we caught this issue) we had 490 characters in the Abstract field.
Abstract should be short and concise. We should restrict this field to ensure no data is written to the DB longer than 150 chars.
Patch coming to restrict field length to < 150 chars and update the field instructions.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | restrict-abstract-to-150-3108083-2.patch | 1.43 KB | bygeoffthompson |
Comments
Comment #2
bygeoffthompson commentedAttached patch updates the metatag UI's instructions and restricts form field length.
Thanks
Comment #3
bygeoffthompson commentedComment #4
anybodyWell I do not agree here. The limit to 255 chars is ok due to technical reasons (varchar), but 150 characters is just a recommendation and should not be enforced by the module.
Anyway what we could do is to add a configuration to set the limit as warning or auto-trim on the configuration page. Then every site ower can decide what to do. See #2958193: Automatically trim meta tag lengths (D9). This could also be combined with #2717017: Add a summary field count function for description metatag and similar issues. It would be great to have your help for a clever solution. Thanks a lot!
Comment #5
damienmckennaWhile I really appreciate you taking the time to open this and provide a patch, I'm not going to commit this as it isn't a hard requirement. Let's focus on #2958193 instead.