Problem/Motivation
The title_length_install() function does not respect $settings['node_title_length_chars'] when updating the definition for the title field:
$fields['title']->setSetting('max_length', 500);
Steps to reproduce
1. Set $settings['node_title_length_chars'] = 2000; in settings.php
2. Enable this module
3. Get the "Mismatched entity and/or field definitions" in the status report page (/admin/reports/status)
Proposed resolution
$fields['title']->setSetting('max_length', 500);
should be
$fields['title']->setSetting('max_length', $length);
Comments
Comment #2
stefan.butura commentedComment #3
vagelis-prokopiou commentedThe patch works as described/expected.
Comment #4
ivnishConfirm. It works
Comment #5
ivnishIf you want to update field after module installing, update settings.php and run drush php-eval "module_load_install('title_length'); title_length_install();"
Comment #6
seth.e.shaw commentedI can also confirm this works on D 9.2.5. I've sent a message to @cbccharlie via the Drupal contact form; so hopefully we can get this in and tagged.
Comment #7
cbccharlie commentedExcuse me, but I had forgotten to check this issue. I hope I can review it this week and create a new version. Thank you!
Comment #9
cbccharlie commentedComment #10
cbccharlie commented