Currently, it is not possible to set the Schema type on other entity types than nodes (using the UI). This is a follow-up of #1296760: Support for setting type on Entity and fixes part of issue #2416531: Fields in field collections don't seem to work.

Patch follows.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BarisW’s picture

Status: Active » Needs review
FileSize
4.05 KB
BarisW’s picture

The major change is that the form is now moved to the Field UI tab instead of the Node Type edit tab.

Status: Needs review » Needs work

The last submitted patch, 1: use_schema_org_type_on-2416635-1.patch, failed testing.

BarisW’s picture

Status: Needs work » Needs review
FileSize
5.68 KB

Now with updated tests.

Status: Needs review » Needs work

The last submitted patch, 4: use_schema_org_type_on-2416635-4.patch, failed testing.

BarisW’s picture

Status: Needs work » Needs review
FileSize
5.89 KB
971 bytes

Sigh. Note to self: always test local first.

Eat this, testbot. Apologies for the noise.

BarwonHack’s picture

Seem to be woorking quite well thanks BarisW.

Hoping schemaorg and efb maintainers review and respond soon.

scor’s picture

Status: Needs review » Needs work

Hi @BarisW!

Thanks for your contribution! It's a good idea to piggy back on the field overview form instead of the edit form.

+++ b/modules/schemaorg_ui/schemaorg_ui.module
@@ -8,46 +8,54 @@
+    '#description' => t('Specify the type you want to associated to this content type e.g. Article, Blog, etc.'),

Could we get a somewhat more contextualized message here, since we know what entity type we looking at? I'm also realizing there has been a typo here for a while in the original code :)

SocialNicheGuru’s picture

This patch introduces this error:
Notice: Undefined index: rdftype in schemaorg_ui_form_field_ui_field_overview_form_submit() (line 55 of schemaorg/modules/schemaorg_ui/schemaorg_ui.module).

 $mapping['rdftype'] = schemaorg_ui_terms_merge($form_state['values']['schemaorg_ui_type'], $mapping['rdftype']);

I get it on entities like registration.
I did not specify a schema type, hit enter, and got the above error when saving an entity_registration.