Custom Field module integration

Created on 9 March 2023, over 1 year ago
Updated 14 March 2023, over 1 year ago

Problem/Motivation

The Custom Field module ( https://www.drupal.org/project/custom_field β†’ ) is actively maintained.
It is an alternative to the Flexfield module, which hasn't seen a commit since November 2021.

Steps to reproduce

Not applicable.

Proposed resolution

Write a new Schema.org Blueprints Custom Field module.
It's possible that Schema.org Blueprints Flex Field would serve as a good starting point for this effort.

Notes

  • The goal is feature parity with flexfield.module
  • Use Recipe with Nutrition Information as the development example.
  • Track features or suggestions for the custom_field.module.
  • schemadotorg_custom_field.module should be marked as experimental
  • custom_field.module solution is similar to flexfield.module

Remaining tasks

  • Update MODULES.md and composer.libraries.json
  • Copy schemadotorg_flexfield.module and rename schemadotorg_custom_field.module
  • Update hook_schemadotorg_property_field_alter()
  • Confirm field storage configuration
  • Confirm field instance configuration
  • Confirm form display settings
  • Confirm view display settings
  • Update schemadotorg_flexfield_preprocess_flexfield()
  • Update schemadotorg_flexfield_schemadotorg_jsonld_schema_property_alter()
  • Add SchemaDotOrgCustomFieldManager service
  • Add basic test coverage for the manager service

User interface changes

Allow user to choose Custom Field fields in the Schema.org field mappings

API changes

Not applicable.

Data model changes

Unknown at this time.

Steps to manually review

  • Create a clean installation with the schemadotorg_custom_field.module enabled
  • Create a Recipe entity type.
    /admin/structure/types/schemadotorg?type=Recipe
  • Confirm that 'nutrition' is using a 'Custom field'
    /admin/structure/types/manage/recipe/fields
  • Review 'nutrition' field storage.
    /admin/structure/types/manage/recipe/fields/node.recipe.schema_nutrition/storage
  • Review 'nutrition' field instance.
    /admin/structure/types/manage/recipe/fields/node.recipe.schema_nutrition
  • Review form display.
    /admin/structure/types/manage/recipe/form-display
  • Review views display.
    /admin/structure/types/manage/recipe/display
  • Create a Recipe node.
    /node/add/recipe
  • Confirm units are added to the node edit form
  • Confirm units are added to node view
  • Confirm JSON-LD includes units
✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agileadam Maine, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @agileadam
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    The Custom Field module is currently a 1-to-1 replacement for the Flexfield module. Providing basic support for the Custom Field module is not a lot of work, and I can do the initial setup. My hope is with some baseline support; we can push the Custom Field module forward toward being stable.

    Below are my notes for creating an MVP integration

    Notes

    • The goal is feature parity with flexfield.module
    • Use Recipe with Nutrition Information as the development example.
    • Track features or suggestions for the custom_field.module.
    • schemadotorg_custom_field.module should be marked as experimental
    • custom_field.module solution is similar to flexfield.module

    Tasks

    • Copy schemadotorg_flexfield.module and rename schemadotorg_custom_field.module
    • Update hook_schemadotorg_property_field_alter()
    • Confirm field storage configuration
    • Confirm field instance configuration
    • Confirm form display settings
    • Confirm view display settings
    • Update schemadotorg_flexfield_preprocess_flexfield()
    • Update schemadotorg_flexfield_schemadotorg_jsonld_schema_property_alter()
    • Add SchemaDotOrgCustomFieldManager service
    • Add basic test coverage for the manager service
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • @jrockowitz opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Since the module is marked as experimental, I am inclined to merge it and make additional improvements as needed.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
    • b6defe11 committed on 1.0.x
      Issue #3347028 by jrockowitz: Custom Field module integration.
      
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024