Needs review
Project:
Microdata
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2012 at 08:38 UTC
Updated:
12 Oct 2013 at 11:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI tried both adding a field to the user programmatically and enabling profile and adding a field to the profile. I could not reproduce this error.
Comment #2
harbhub commentedI have this same error:
Notice: Undefined index: microdata in microdata_form_field_ui_field_edit_form_submit() (line 242 of C:\xampp\htdocs\harb1\sites\all\modules\microdata\includes\microdata.form_alter.inc).
Warning: Invalid argument supplied for foreach() in microdata_form_field_ui_field_edit_form_submit() (line 242 of C:\xampp\htdocs\harb1\sites\all\modules\microdata\includes\microdata.form_alter.inc).
Line 242 of C:\xampp\htdocs\harb1\sites\all\modules\microdata\includes\microdata.form_alter.inc looks like this:
foreach ($values['microdata']['fields'] as $field_name => $field_values) {
The entire function starts on line 233 and ends on line 266. This entire function reads as follows:
/**
* Submit callback; saves field mapping in both UIs.
*/
function microdata_form_field_ui_field_edit_form_submit($form, &$form_state) {
$entity_type = isset($form_state['#entity_type']) ? $form_state['#entity_type'] : $form['instance']['entity_type']['#value'];
$bundle = isset($form_state['#bundle_type']) ? $form_state['#bundle_type'] : $form['instance']['bundle']['#value'];
$values = $form_state['values'];
$mapping = _microdata_load_mapping($entity_type, $bundle);
foreach ($values['microdata']['fields'] as $field_name => $field_values) {
$subfields = _microdata_get_field_properties($entity_type, $bundle, $field_name);
// If the field itself is microdata enabled, add the mapping for the field.
if (isset($field_values['field'])) {
$mapping[$field_name] = array(
'#itemprop' => drupal_explode_tags($field_values['field']['itemprop']),
);
// If the field should be handled as an item, add the is_item flag to the
// field's mapping and save the itemtype.
// @todo Consider adding the itemid.
if (!empty($field_values['field']['is_item'])) {
$mapping[$field_name]['#is_item'] = TRUE;
if (isset($field_values['field']['item_fieldset']['itemtype'])) {
$mapping[$field_name]['#itemtype'] = drupal_explode_tags($field_values['field']['item_fieldset']['itemtype']);
}
else {
$mapping[$field_name]['#itemtype'] = array();
}
}
else {
$mapping[$field_name]['#is_item'] = FALSE;
}
}
Any suggestions on how to fix this?
Comment #3
jimi commentedI have the same problem after enabling the modules Profil2 and Addressfield.
when I change the address field of my profile :
Notice : Undefined index: real path dans microdata_form_field_ui_field_edit_form_alter() (line 99 in */modules/microdata/includes/microdata.form_alter.inc).
line 99 -> $edit_path = $entity_info['bundles'][$bundle]['admin']['real path'];
Comment #4
Anonymous (not verified) commentedI was actually able to reproduce this with Token in contrib, so moving this to active.
I believe this will happen with form elements which have been inserted into the render array for non-field things or fields that don't have support.
Comment #5
svg1405 commentedHello!
I have the problem after changing the text processing from the plain text to the filtered text. There is widget Textarea in the custom content type.
Notice: Undefined index: subfields in microdata_form_field_ui_field_edit_form_submit() (line 271 of C:\Sites\home\drupal7\sites\all\modules\microdata\includes\microdata.form_alter.inc).
line 271: '#itemprop' => drupal_explode_tags($field_values['subfields'][$subfield_name]['itemprop']),
Comment #6
Anonymous (not verified) commentedsvg1405, can you try clearing your caches and see if that resolves the issue?
Comment #7
burko commentedTried clearing the caches, this has not fixed the issue.
Both 'microdata' and 'fields' are undefined within the function. I am not sure what they need to be defined as to resolve the error.
I am still very new to programming.
help would be appreciated.
Comment #8
Anonymous (not verified) commentedCan you try downloading the dev version of the module?
Comment #9
Anonymous (not verified) commentedHello chaps,
I'm getting this error on D7's default User content-type. No idea how I managed it, but the error is thus:
Notice: Undefined index: real path in microdata_form_field_ui_field_edit_form_alter() (line 99 of /home/thetenor/public_html/sites/all/modules/microdata/includes/microdata.form_alter.inc).
On the page:
/?q=admin/config/people/accounts/fields/field_user_description&destinations[0]=admin/config/people/accounts/fields
Comment #10
mattew commentedI propose a patch.
Comment #11
mattew commentedThis is a very simple fix, avoiding error message, author should make a review.
It is not obvious reading the patch, because indentation change, but I just add a test before the foreach loop :
Comment #12
mihai7221 commentedI tested with 7.x-1.0-beta2 and with 7.x-dev and the latest patch doesn't work. (I cleared my cached)
Comment #13
csheriff commentedI was having the same problem...that fixed it! Thanks!
Comment #14
Volx commentedI ran across the same problem, patch #11 fixed it for me too. Thanks.
Comment #15
urkon commentedPatching failed but manual fixing based on #11 patch was success.
Thanx.
P.S.:
After comparing #11 with my patch the main diference was in starting line:
@@ -240,47 +240,50 @@ ... ----> @@ -239,47 +239,50 @@ ...
and my git root was not on the module but on drupal project.
Comment #16
urkon commentedNow I have similar issue in other line. This happens after #11 fix.
When I add new field of type 'term reference' in 'product variation types' in commerce module. I think it is not commerce related.
Notice: Undefined index: real path in microdata_form_field_ui_field_edit_form_alter() (line 99 of ..../sites/all/modules/microdata/includes/microdata.form_alter.inc).
My guess is that the way of #11 fix is needed elsewhere too.
I am a noob in php but will try to fix this since I have a known pattern.
Comment #17
urkon commentedSorry.
It seems this is other issue (https://drupal.org/node/1218800) in drupal commerce module.
Comment #18
urkon commentedHi.
Here is my solution to #16 issue variation. As #17 says this may not be issue of this module, but it can represent here if other modules are not complete.
This patch helps me to have full functionality. This is more workaround than fix.
Since I do not have experience in this community please check if solution matches your standards.