diff --git a/xmlsitemap_entity/xmlsitemap_entity.module b/xmlsitemap_entity/xmlsitemap_entity.module index 3255535..e919f6d 100644 --- a/xmlsitemap_entity/xmlsitemap_entity.module +++ b/xmlsitemap_entity/xmlsitemap_entity.module @@ -264,6 +264,15 @@ function _xmlsitemap_entity_xmlsitemap_update_link($entity_type, $entity) { $changed = $entity->updated; } + // Fix "status_override" and "priority_override". Without this, they are 0 + // and the entity form does not reflect any saved overrides for this entity. + if (isset($entity->xmlsitemap['status']) && $entity->xmlsitemap['status'] != 'default') { + $entity->xmlsitemap['status_override'] = ($entity->xmlsitemap['status'] != $settings['status']); + } + if (isset($entity->xmlsitemap['priority']) && $entity->xmlsitemap['priority'] != 'default') { + $entity->xmlsitemap['priority_override'] = ($entity->xmlsitemap['priority'] != $settings['priority']); + } + // Add some sitemap properties. $entity->xmlsitemap += array( 'id' => $entity_id, diff --git a/xmlsitemap_file/xmlsitemap_file.module b/xmlsitemap_file/xmlsitemap_file.module index a381a83..a49388d 100644 --- a/xmlsitemap_file/xmlsitemap_file.module +++ b/xmlsitemap_file/xmlsitemap_file.module @@ -47,3 +47,12 @@ function xmlsitemap_file_entity_info_alter(&$entity_info) { // Set $entity->timestamp as last modification date of file $entity_info['file']['xmlsitemap']['changed property'] = 'timestamp'; } + +/** + * Implements hook_form_alter(). + */ +function xmlsitemap_file_form_file_entity_edit_alter(array &$form, array &$form_state) { + // Add the link options. + module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); + xmlsitemap_add_form_link_options($form, 'file', $form['type']['#value'], $form['fid']['#value']); +} \ No newline at end of file