Periodic "undefined method content_type" behavior on Heroku #12

watson opened this Issue Feb 27, 2011 · 0 comments


None yet
1 participant

watson commented Feb 27, 2011


I'm using the page-attachments extension together with S3 in development without any issues - it works like a charm :) But for some reason when I deploy to Heroku not all images show correctly in the frontend.

Lets say I have a page with 4 images, all existing on S3 and all viewable by clicking the link inside Radiant admin. If I'm lucky they all show fine in the frontend. But mostly, I find that either all or only some of the images will display. When opening up the page in admin and re-saving it 2-10 times then suddenly all images will display. But then later, maybe because the page is saved again, some or all images will not display again.

Instead of a missing image, an error-message is displayed inline where the image where suppose to be:

undefined method `content_type’ for nil:NilClass

I can't see any pattern. Some pages have all their images displayed, some have none and some have only half. And it seems to change after saves - but only sometimes and without a pattern.

I'm running on the Heroku "bamboo-ree-1.8.7" stack with the latest version of the page-attachments extension and the following version of Radiant:

I think the undefined method 'content_type' for nil:NilClass is from the r:attachment:image tag inside page-extensions app/models/page_attachment_tags.rb. In that case the problem is that page.attachment(name) doesn't return the attachment. But why?? And why only sometimes. Can't get my head around it?!

Hope you guys can help :)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment