Description of the need
Add hook_field_schema_alter()
, as described in https://www.drupal.org/node/691932, which has been merged into Drupal 7 core as of 7.99. See https://www.drupal.org/node/3406312
For the reasons we have hook_schema_alter() - mainly site-specific tweaks, we should allow the same for field storage.
It would make it easier to implement a contrib module (like date_repeat
) that would alter core fields (like core date fields).
Proposed solution
Apply this patch: https://www.drupal.org/files/issues/2023-03-16/drupal-field_schema_alter... or similar.
Alternatives that have been considered
hook_schema_alter()
can be used too but it requires checking for each table to see if it's of the right field type and also requires also handling field creation and deletion so it's more work than the proposed new hook.
Example implementation
``` /** * Allow modules to alter the schema for a field. * * @param array $schema * The schema definition as returned by hook_field_schema(). * @param array $field * The field definition. * * @see field_retrieve_schema() */ function hook_field_schema_alter(&$schema, $field) { if ($field['type'] == 'image') { // Alter the length of a field. $schema['columns']['alt']['length'] = 2048; // Add an additional column of data. $schema['columns']['additional_column'] = array( 'description' => "Additional column added to image field table.", 'type' => 'varchar', 'length' => 128, 'not null' => FALSE, ); // Add an additional index. $schema['indexes']['fid_additional_column'] = array('fid', 'additional_column'); } } ````
Recent comments
I think given the warning on the source site: At this time, if your new project can afford to require PHP 5.5+, which it should, please use PHP's native password_hash() /...
July 31, 2025
I did a very quick test and if the Display format of the webform submission value is HTML then it appears but if plain text then it doesn't, so something is included regardless of if empty when...
"Hide rewriting if empty" has no effect
Just to clarify it appears that the item: Fix Search for "On the Web" module, is about the search on backdropcms.org at https://backdropcms.org/modules
July 31, 2025