-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chronicle breaks snippets with NoMethodError #48
Comments
Probably it's just a byproduct of that failed PostgreSQL migration. Snippets don't have status in Radiant core; chronicle adds that, so if the migration failed, it would make sense that snippet.status would be nil. |
But, this is the failed migration; that column exists, but from what I can see is not limited in size:
|
The problem is that the extension was installed after there were snippets in the database. When chronicle created a status_id column in the snippets table, it left the status_id NULL. This is what caused the backtrace. To fix the problem I updated all Snippets to have a status_id of 100, which is published. Now things are working as expected. |
Great sleuthing! I'll look at fixing it sometime. |
Same problem with layouts; status_id needs to be set to 100 for all existing layouts. |
Just wanted to +1 this -- suggested fix via console worked great. It should be easily fixed by adding ":default => 100" to the migration that adds the status field. |
When installing Chronicle, the snippets tab in the admin breaks and any snippets used on a site show up with "Snippet not found". Below is the error when going to /admin/snippets:
NoMethodError in Admin/snippets#index
Showing vendor/extensions/chronicle/app/views/admin/snippets/index.html.haml where line #26 raised:
undefined method `name' for nil:NilClass
Extracted source (around line #26):
23: = image('snippet', :alt => 'snippet-icon')
24: %span= link_to snippet.name, edit_admin_snippet_url(snippet)
25: - tbody.status_cell do
26: %td.status{:class => "#{snippet.status.name.downcase}-status"}
27: = snippet.status.name
28: - if snippet.status_id >= Status[:published].id && snippet.current.status_id < Status[:published].id
29: %span.status{:class => "#{snippet.current.status.name.downcase}-status"}
RAILS_ROOT: /Users/berto/Places/nutricate/smartreceipt.com/radiant
The following extensions are installed; are there, by chance, incompatibilities with one of these:
Also, I skipped the last migration that limits the version column to 64kb; not sure if that would cause the problem.
Any ideas?
Thanks.
The text was updated successfully, but these errors were encountered: