Skip to content
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

Page Model Modifying Extensions break Chronicle Extension #38

Open
ehaselwanter opened this issue Jul 30, 2009 · 3 comments
Open

Page Model Modifying Extensions break Chronicle Extension #38

ehaselwanter opened this issue Jul 30, 2009 · 3 comments

Comments

@ehaselwanter
Copy link
Contributor

  1. install Chronicle
  2. greate some pages
  3. install e.g. gallery extension
    4 ==> cannont edit any page
  4. delete all entries from version table
    6 ==> pages are editable again

I think this has something to do with the yaml outline, maybe the yaml must be enriched with the current Page fields?

@ehaselwanter
Copy link
Contributor Author

i do experience the same problems. I found that if I just load and save a page with the rails console it fixes this issue. A solution could be to do this in a migration, or even better somehow tell the chronicle extension to update its persistence yaml to include/merge new attributes coming from a recent extension installation?

@ehaselwanter
Copy link
Contributor Author

or even better: vote for radiant core integration +1

@arturmarc
Copy link

I think i found a fix for this: has to do with the url method
heres a diff of the two lines I changed to make this work
--- a/vendor/extensions/chronicle/app/helpers/admin/preview_helper.rb
+++ b/vendor/extensions/chronicle/app/helpers/admin/preview_helper.rb
@@ -21,6 +21,6 @@ module Admin::PreviewHelper
when :live
Radiant::Config['live.host'] || host
end
- protocol + host + page.url(mode == :live)
+ protocol + host + page.url_with_draft_awareness(mode == :live)
end
end
\ No newline at end of file
diff --git a/vendor/extensions/chronicle/lib/chronicle/page_extensions.rb b/vendor/extensions/chronicle/lib/chronicle/page_extensions.rb
index d1a2406..d1eae9a 100644
--- a/vendor/extensions/chronicle/lib/chronicle/page_extensions.rb
+++ b/vendor/extensions/chronicle/lib/chronicle/page_extensions.rb
@@ -73,7 +73,7 @@ module Chronicle::PageExtensions
else
return nil if virtual?
url = clean_url(url) if clean
- my_url = self.url(live)
+ my_url = self.url_with_draft_awareness(live)
if (my_url == url) && (not live or published?)
self.current
elsif (url =~ /^#{Regexp.quote(my_url)}([^\/]*)/)

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

No branches or pull requests

2 participants