locomotivecms/engine — Issue #289: Content Types with files
Author: cwoodcox
Created: 2012-01-27 02:00:02+00:00
State: open

It's not prohibited in the UI, but it either needs to be, or this issue needs to be worked on. Right now, I don't see much of a solution outside just saying "file as the primary field is not allowed."

Basically, if I create a content type like "Photos" and I make a file the first field, and then I add a caption, or any other fields that I want, and then save it, and then try to upload a photo, I get a weird exception when trying to generate the Permalink. My guess is that Locomotive is using the primary field for the permalink, and there's no permalink generator on the FileUploader. The exception looks like this (I lost the entire stack trace.)

```Completed 500 Internal Server Error in 12ms

NoMethodError (undefined method `permalink!' for #):
```

I got around it by making the caption field the first one so we have some text to go off of, but I'd like a little more elegant solution. More than happy to write it, but I wanted some input on what would be the best approach.