Skip to content

Commit

Permalink
v.1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
findlabnet committed Jul 7, 2018
1 parent 0836ccf commit eda72d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion seo_meta.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package = SEO
backdrop = 1.x
type = module
configure = admin/config/metadata/seo_meta
version = 1.0.13
version = 1.0.14
16 changes: 11 additions & 5 deletions seo_meta.module
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,24 @@ function seo_meta_get_node_data(Node $node) {
function seo_meta_node_presave(Node $node) {

if (isset($node->seo_meta['enabled']) && $node->seo_meta['enabled'] == 1) {
// save OG image as permanent file
// save OG image as permanent file
if (!empty($node->seo_meta['open_graph']['meta_og_image_fid'])) {
$file = file_load($node->seo_meta['open_graph']['meta_og_image_fid']);
$file->status = FILE_STATUS_PERMANENT;
file_save($file);
file_usage_add($file, 'seo_meta', 'node', $node->nid);
file_usage_add($file, 'file', 'file', $file->fid);
}

}
}

/**
* Implements hook_node_insert().
*/
function seo_meta_node_insert(Node $node) {
if (isset($node->seo_meta['enabled']) && $node->seo_meta['enabled'] == 1) {
$data = seo_meta_get_node_data($node);

seo_meta_record_insert($data);
}
}
}

/**
Expand Down

0 comments on commit eda72d3

Please sign in to comment.