backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Bundle field should be longer #191

Open oriolroger opened 2 months ago

oriolroger commented 2 months ago

Hi, we're getting some errors when creating a paragraph with a long machine name. The error we get is: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'bundle' at row 1: INSERT INTO {paragraphs_item}

Currently, the fields "bundle" and "field_name" in the "paragraphs_item" database table are defined as Varchar(32), but we've seen that in most of the tables the "bundle" field is at least Varchar(128), and even 255 long in some tables (like "relation_bundles").

We're adding a patch in our site, on the function paragraphs_schema(), but we wonder if this should be something to be fixed in this module.

Thanks!

yorkshire-pudding commented 2 months ago

I'm fairly sure that field is right. As in core, if you try to add a field machine name longer than 32 it won't let you chrome_Mynikluyao

I also get exactly the same result for the bundle field in creating a new paragraph so it looks like this is by design as the form there is limited to 32. How did you get that error? Did you create the paragraph type programmatically and then add a paragraph of that type?

If there is a genuine need for some paragraph types to have a longer bundle name, then there probably needs to be a documented use case/user story.

laryn commented 2 months ago

@oriolroger Can you provide a bit more context and some of the examples you mention? In referring to the node module in core, I see that the schema for type is 32: