Problem/Motivation

Setting default values for additional types can't be done using field defaults.

Proposed resolution

  • Create service SchemaDotOrgAdditonalTypeDefaultValues
  • Add ::entityCreate. method
  • Only set the default value if the field empty
  • For simple values (string, int, or bool) detect the default property.
  • Can you cache by entity type bundle and additional type
  • Alter Schema.org mapping form to include default values under 'Additional type' details
  • Support multiple default values

Examples

entity_type_id—SchemaType—additional_type:
  field_name: value
  schemaProperty: value
entity_type_id—SchemaType—bundle--additional_type:
  field_name: value
  schemaProperty: value
entity_type_id—bundle—additional_type:
  field_name: value
  schemaProperty: value

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jrockowitz created an issue. See original summary.

  • jrockowitz committed 2cbfd43c on 1.0.x
    [#3554079] feat: Set default values for entity additional types
    
jrockowitz’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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