Skip to content

Commit

Permalink
Invalid entity types and missing property information fixes. Re: Dena…
Browse files Browse the repository at this point in the history
…'s notes. Thanks Dena.
  • Loading branch information
sherakama committed Dec 10, 2014
1 parent d285c53 commit 587d1e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stanford_capx.forms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ function stanford_capx_mapper_form_get_entity_mapping_form($form, &$form_state,

$form['entity-mapping']['entity-type'] = array(
'#type' => 'select',
'#title' => t("Select entity type"),
'#description' => isset($mapper->machine_name) ? t("This field has been disabled and cannot change once it has been set.") : t(''),
'#options' => $entity_options,
'#default_value' => isset($mapper->entity_type) ? $mapper->entity_type : 'node',
Expand Down Expand Up @@ -370,8 +371,10 @@ function stanford_capx_mapper_form_get_field_mapping_form($form, &$form_state, $
),
);

$properties = $entity_info['properties'];
$properties = stanford_capx_filter_properties($entity_machine_name, $properties);
$properties = isset($entity_info['properties']) ? $entity_info['properties'] : array();
if (!empty($properties)) {
$properties = stanford_capx_filter_properties($entity_machine_name, $properties);
}

foreach ($properties as $property_machine_name => $prop_info) {

Expand Down
3 changes: 3 additions & 0 deletions stanford_capx.module
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ $CAP_RESTRICTED_ENTITY_TYPES = array(
'comment',
'taxonomy_vocabulary',
'field_collection_item',
'redirect',
'wysiwyg_profile',
'menu_link',
);

global $CAP_RESTRICTED_FIELD_PROPERTIES;
Expand Down

0 comments on commit 587d1e4

Please sign in to comment.