Permalink
Browse files

v6.59.4. Bugfix.

- v6.59.4 December 20, 2013
	- Added a warning when trying to set the `id` attribute manually
		- Thanks to [Piotr Zduniak](https://github.com/pzduniak) for [issue
#742](#742)
  • Loading branch information...
1 parent 8264603 commit a885e3b8ceda574ddd04e412a4822676610628c1 @balupton balupton committed Dec 20, 2013
Showing with 15 additions and 1 deletion.
  1. +4 −0 HISTORY.md
  2. +1 −1 package.json
  3. +10 −0 src/lib/models/document.coffee
View
@@ -1,5 +1,9 @@
# History
+- v6.59.4 December 20, 2013
+ - Added a warning when trying to set the `id` attribute manually
+ - Thanks to [Piotr Zduniak](https://github.com/pzduniak) for [issue #742](https://github.com/bevry/docpad/issues/742)
+
- v6.59.3 December 20, 2013
- Fixed uninstalled dev dependency plugins (e.g. livereload), from being reinstalled on the next install
- Thanks to [Alan Languirand](https://github.com/alanguir), [Eduán Lávaque](https://github.com/Greduan) for [issue #744](https://github.com/bevry/docpad/issues/744)
View
@@ -1,7 +1,7 @@
{
"title": "DocPad. Streamlined web development.",
"name": "docpad",
- "version": "6.59.3",
+ "version": "6.59.4",
"description": "DocPad is a next generation web architecture that lets you create fast static websites with dynamic abilities and powerful abstractions. Write your website as files on your computer, entries in a database, or even RSS feeds and DocPad will import it, generate & render it, then output a static website for deployment anywhere or a dynamic node website for advanced server-side functionality. Use it as a module or standalone. It's purely awesome. Check it out.",
"homepage": "http://docpad.org",
"installUrl": "http://docpad.org/install",
@@ -213,6 +213,16 @@ class DocumentModel extends FileModel
@addUrl(metaDataChanges.urls) if metaDataChanges.urls
@setUrl(metaDataChanges.url) if metaDataChanges.url
+ # Check if the id was being over-written
+ if metaDataChanges.id?
+ @log 'warn', """
+ The document #{@getFilePath()} tried to over-write its `id` attribute with its meta-data.
+ This will cause unexpected issues. We have ignored the `id` attribute changes to prevent further errors.
+ We recommend you rename the `id` meta-data attribute on this document to something else.
+ For more information, see: https://github.com/bevry/docpad/issues/742
+ """
+ delete metaDataChanges.id
+
# Apply meta data
@setMeta(metaDataChanges)

0 comments on commit a885e3b

Please sign in to comment.