- Issue created by @griz
- πΊπΈUnited States tr Cascadia
Well, serial isn't one of the built-in Drupal core field types. It is not a scalable solution to keep adding names of contributed field types. I would prefer a more general solution, using
FormatterBase::isApplicable()
and possibly removing thefield_types
annotation if it is no longer relevant. - Status changed to Needs work
over 1 year ago 4:12am 14 May 2023 - πΊπΈUnited States SocialNicheGuru
Just uploading a rerolled version for Barcodes 2.0.x.
- πΊπΈUnited States tr Cascadia
Like I said, this will not be added to the module. This issue is still active because I'm open to a solution that allows site builders to customize this without hacking or patching code.
The standard way to customize Drupal for your site is to implement a hook. This would work for your needs, for example:
/** * Implements hook_field_formatter_info_alter(). */ function yourmodule_field_formatter_info_alter(array &$info) { // Allow the barcode field formatter to be used on a new field type. $info['barcode']['field_types'][] = 'serial'; }
And I feel that for reference I need to add that "yourmodule" should be replaced with the name of your module that you are using to customize your site. Read the documentation on how to implement a hook for details.
- Status changed to Active
3 months ago 8:38pm 27 August 2024