Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi!
I am using commerce with marketplace. When I try to edit the product variation types, I get the following errors: I am also using Entity Field Builder (efb) module which makes use of schemaorg.
Notice: Undefined index: rdftype in schemaorg_ui_term_load() (line 216 of /home/antogeorge/public_html/vshop/sites/all/modules/schemaorg/schemaorg_ui/schemaorg_ui.module).
Warning: Invalid argument supplied for foreach() in schemaorg_ui_term_load() (line 222 of /home/antogeorge/public_html/vshop/sites/all/modules/schemaorg/schemaorg_ui/schemaorg_ui.module).
Please help...
Comment | File | Size | Author |
---|---|---|---|
#11 | variation_type_2.png | 53.19 KB | gonzalves |
#11 | variation_type_1.png | 47.48 KB | gonzalves |
#11 | content_type_2.png | 73.85 KB | gonzalves |
#11 | content_type_1.png | 58.55 KB | gonzalves |
Comments
Comment #2
scor CreditAttribution: scor commentedShould be fixed now in the dev snapshot which you can download from https://drupal.org/node/1183816 (allow a few hours for it to get rebuilt).
Comment #3
gonzalves CreditAttribution: gonzalves commentedHi Scor, thank you for your quick response.. I uninstalled and installed the module and updated the new dev as you suggested.. Still I get the same error.. except that the line number has changed... I am using Schema cache module and that was run by using cron.
Notice: Undefined index: rdftype in schemaorg_ui_term_load() (line 205 of all/modules/schemaorg/modules/schemaorg_ui/schemaorg_ui.module).
Warning: Invalid argument supplied for foreach() in schemaorg_ui_term_load() (line 211 of /all/modules/schemaorg/modules/schemaorg_ui/schemaorg_ui.module).
Comment #4
gonzalves CreditAttribution: gonzalves commentedHi Scor, I noticed that I get the error only when I enable efb module. In fact variation types do not have an option to map the schema.org and when we open variation types edit field, it brings up an option to map the field with empty values. Is there a way we can map schema.org under variation types?
Comment #5
scor CreditAttribution: scor commentedCould you check what code you have at line 205 of all/modules/schemaorg/modules/schemaorg_ui/schemaorg_ui.module? It shouldn't matter what modules you're using, the code I added should avoid this entirely.
Comment #6
scor CreditAttribution: scor commentedsorry, it's line 204 that I'm interested in seeing actually.
Comment #7
gonzalves CreditAttribution: gonzalves commentedDo you suggest I come on IRC? The lines are:
204
if ($field == 'rdftype') {
198 -216
/**
* Loads the schema.org term for a particular Drupal field or rdftype.
*/
function schemaorg_ui_term_load($type, $bundle, $field) {
$terms = array();
$mapping = rdf_mapping_load($type, $bundle);
if ($field == 'rdftype') {
$terms = $mapping['rdftype'];
}
elseif (!empty($mapping[$field]['predicates'])) {
$terms = $mapping[$field]['predicates'];
}
// Return the first schema: term.
foreach ($terms as $term) {
if (strpos(trim($term), 'schema:') === 0) {
return str_replace('schema:', '', $term);
}
}
}
Comment #8
scor CreditAttribution: scor commentedThat's what I thought. You don't have the fix. It might be that the release hadn't been rebuilt yet when you downloaded it. Please try now. Alternatively you can use git to get the latest:
(Here is the change you should have in your code if you download the right version)
Comment #9
gonzalves CreditAttribution: gonzalves commentedYes, That has fixed the error.. Thank You Scor...
However, the mapping of the metadata fields has not been enabled for variation types.. Are we able to extend the mapping towards Variation types as well??? Thanks again...
Comment #10
scor CreditAttribution: scor commentedCould you provide more info please? screenshots, steps, etc. I'm not sure I understand.
Comment #11
gonzalves CreditAttribution: gonzalves commentedHi Scor, I have added 4 screenshots based on the sequence. In the content type (Display), I have an option to specify the shema and am able to map the fields based on the schema. However, when I create a variation, I do not have an option to map the schema and hence I am not able to choose the fields against the schema. I am using Entity Fields Builder module to have the fields mapped.
Comment #12
scor CreditAttribution: scor commentedI think this feature should allow you to choose a type for your variation: #2416635: Use Schema.org type on all entity types - please test the patch over there and provide feedback. If you still have problems, please open a new issue, the initial problem as described in the OP is fixed.