Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
Fixing bugs in con
Browse files Browse the repository at this point in the history
  • Loading branch information
cliftonc committed Jun 18, 2011
1 parent 83661fb commit 77a2f0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/core/content/content.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,15 @@ function getForm(req,action,title,contentType,next) {
// Get content type
var ContentType = calipso.lib.mongoose.model('ContentType');

ContentType.findOne({contentType:contentType}, function(err, contentType) {
ContentType.findOne({contentType:contentType}, function(err, ct) {

// Add any fields
if(!err && contentType && contentType.get("fields")) { // FIX as this added later, get is 'safer' if not existing in document
if(!err && ct && ct.get("fields")) { // FIX as this added later, get is 'safer' if not existing in document

var fields = [];

try {
var fields = JSON.parse(contentType.fields)
var fields = JSON.parse(ct.fields)
} catch(ex) {
// Issue with our fields
req.flash("error",req.t("The content type you are editing has invalid fields defined, please check the content type configuration."));
Expand Down

0 comments on commit 77a2f0c

Please sign in to comment.