avonderluft / radiant-concurrent_draft-extension Goto Github PK
View Code? Open in Web Editor NEWRadiantCMS extension for concurrent drafts
RadiantCMS extension for concurrent drafts
If I remove a page part from a page and click "Save and Publish" I consistently get the following exception:
A TypeError occurred in pages#update:
can't modify frozen hash
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:313:in `[]='
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:313:in `write_attribute_without_dirty'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/dirty.rb:139:in `write_attribute'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:211:in `content='
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/base.rb:2745:in `send'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/base.rb:2745:in `attributes='
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/base.rb:2741:in `each'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/base.rb:2741:in `attributes='
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/base.rb:2627:in `update_attributes'
[RAILS_ROOT]/vendor/extensions/concurrent_draft/lib/concurrent_draft/model_extensions.rb:43:in `promote_draft!'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in `to_proc'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:364:in `method_missing_without_paginate'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:219:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:219:in `each'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:219:in `send'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:219:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:364:in `method_missing_without_paginate'
[RAILS_ROOT]/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:164:in `method_missing'
[RAILS_ROOT]/vendor/extensions/concurrent_draft/lib/concurrent_draft/page_extensions.rb:4:in `promote_draft_without_notify_content_manager!'
[RAILS_ROOT]/vendor/extensions/draft_notification/lib/draft_notification/page_extensions.rb:9:in `promote_draft!'
[RAILS_ROOT]/vendor/extensions/concurrent_draft/lib/concurrent_draft/admin_controller_extensions.rb:21:in `check_for_promote_now'
...
One fix is to add a reload to #promote_draft! in page_extensions.rb, like so:
def promote_draft!
parts.reload.each(&:promote_draft!)
update_attribute('status_id', Status[:published].id)
super
end
This extension relies on the center() function from javascripts/admin/admin.js (lines 134-142). This function is no longer available in Radiant 0.9.1. In fact, admin.js has been completely removed. The center() function should be relocated to concurrent_draft.js
In some Radiant sites, hidden pages are used to collect assets or provide other content that the designer may not want visible in a direct way. Existing pages that have a status of "hidden" at the time of the extension installation can retain that status, but creating new pages with a status of "hidden" appears impossible since concurrent-draft removes the standard publish setting and the replacement UI does not provide this option. This makes maintaining sites that use this feature very difficult.
in some situations. the page_part.content is being saved with a 'Save'
Needs analysis.
Updates for 0.7 compatibility are complete and tested, but 12 of 48 specs in admin_controller_extensions_spec are still failing. Research and correct.
The draft controls were only working for my client in IE and Safari, not in Firefox. When he was clicking on the box to expose the controls, he was getting this error:
this.element.up(".active") is undefined
It looks like the following behavior instruction in concurrent_draft.js was being ignored by Firefox:
'#draft-controls': Draft.ControlBox
Firefox was dropping through and firing a click event on this instead:
'#draft-controls li.schedule_draft a': Draft.ScheduleLink
I spent an hour trying to figure out why this was happening, but eventually was forced to give up and hack in a solution:
Event.addBehavior({
// This breaks in Firefox for whatever reason
//'#draft-controls': Draft.ControlBox,
'#draft-controls:click': function(e) { e.stop(); this.addClassName('active'); },
'body:click': function() { $('draft-controls').removeClassName('active') },
'#draft-controls li.revert a': Draft.RevertLink,
'#draft-controls li.schedule_draft a': Draft.ScheduleLink
});
Thought I'd share it here. I'd love to know a more elegant way to solve this. Clearly, the problem is with Firefox, but it would be nice for the code to work across all three browsers.
On page/snippets/layout lists there should be an status showing if there were any changes to the page in comparison with the currently published page and if there is a "publish at" date currently set.
I intend to attack this problem some time latter, please comment with any ideas or suggestions on how to do it.
After installing this extension it seems that some characters are coming quoted from the DB into the pages, so for instance a '"' would become " and if I save the page when it loads again this will become even more mangled """ and so on.
I got this error when I use :include_blank => true.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.