When I replace the title field on a content type with this title instance, regardless if I have any data in that content type or not, I am not allowed to change the max field length from 255 characters?

I need to be able to change this. How do I do it?

Thanks

CommentFileSizeAuthor
#4 title-max_length-1668570-4.patch1.7 KBVolx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

IWasBornToWin’s picture

Any suggestions?

jacobpov’s picture

Yeah same problem here I wonder how to change it ?

IWasBornToWin’s picture

I installed validate module and set restrictions there.

Volx’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.0-alpha5
Status: Active » Needs review
FileSize
1.7 KB

I created a patch with a new configuration setting. On the title configuration page admin/config/content/title in the "General" tab you can set the maximum field length.
But beware that this can only take effect when no title field has been created for the specific entity type, i.e. if you have a title field for one node type and want to add a title field for another node type the setting will have no effect, since the database table for the field has already been created with the initial field length.
If you want to change the field length for an existing field I think you could change that directly in the database by changing the field config in the data column of the field_config table AND change the the actual datatype for the title_field_value column in the field_data_title_field and the field_revision_title_field tables.

fox_01’s picture

Why isn't it possible to change the length from existing fields by changing the settings in your new form? This would be great.

Volx’s picture

It would be indeed, but the setting influences how the database table for the title field is created, i.e. the length of the field. Because there is only one title field (only instances are created after the first one), they all use the same database table.
I don't think it is feasable to change the database automatically, because this may cause a lot of issues with content. If you need to change it, you can do so manually without much work as I have written above.

fox_01’s picture

Ok. Is it normal that the field setting show 50 character even if I changed the databse settings how you described above?

Volx’s picture

Yes, the setting will have no effect after the database table has been created and will not be synchronized with the database, but you can still change the setting to match the database so you will not be confused in a year from now :)

fox_01’s picture

How do you adivce to modify the data column which is a serialized binary? Thats looks not as easy as editing a normal column.

pifagor’s picture

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

  • pifagor committed ecd47ef on 7.x-1.x authored by Volx
    Issue #1668570 by Volx, IWasBornToWin, fox_01, jacobpov, pifagor: Can't...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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