Skip to content

Commit

Permalink
Merge pull request #29 from apostrophecms/hotfix/clone-field
Browse files Browse the repository at this point in the history
Clone field instead of directly requiring it.
  • Loading branch information
Tom Boutell committed Nov 20, 2018
2 parents 66e1f5a + 9382506 commit 6f773ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/modules/apostrophe-site-map-custom-pages/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
var _ = require('@sailshq/lodash');
var field = require('../../../siteMapPriorityField.js');

module.exports = {
improve: 'apostrophe-custom-pages',
beforeConstruct: function(self, options) {
if (options.sitemap !== false) {
options.addFields = [
require('../../../siteMapPriorityField.js')
_.clone(field)
].concat(options.addFields || []);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/modules/apostrophe-site-map-pieces/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var _ = require('@sailshq/lodash');
var field = require('../../../siteMapPriorityField.js');

module.exports = {
improve: 'apostrophe-pieces',
Expand All @@ -14,7 +15,7 @@ module.exports = {
}
if (options.sitemap !== false) {
options.addFields = [
require('../../../siteMapPriorityField.js')
_.clone(field)
].concat(options.addFields || []);
}
}
Expand Down

0 comments on commit 6f773ac

Please sign in to comment.