Sorry to keep updating this, but I've found where the problem (well my
problem, but I'm sure others will see it) lies.
If I export the database using import_export, and then try and import
into a new empty radiant install where I've pre-installed all my
extensions, then import_export appears to drop and re-create the
tables as per the radiant basic schema.
However, the reorder extension creates a "position" field in the pages
table which then gets removed on import, causing the import to fail
due to this field being in the export.yml file, but now not existing
in the import database.
I'm not sure the best way around this - whether import_export should
not re-create the tables and just insert into the existing ones (could
be useful for merging 2 sets of data too) or if it needs to look at
the migrations that had taken place on the exported database and make
sure they have also taken place on the import side.
Also, it should be noted that this re-creating the tables and removing
the position field, breaks the migrations as the reorder-1 migration
entry is left in the schema_migrations table meaning that trying to re-
install the reorder extension fails to run the migration again.
Running the uninstall migration also fails as the field isn't there to
delete anymore. The manual fix is as per below.
I hope my waffling on this list is ok - I don't want to tread on any
toes as I'm new to radiant!
Thanks,
Jonathan.
On 30 Jul 2009, at 11:38, Jonathan Batchelor wrote:
I have fixed it by checking my schema_migrations table and deleting
the Reorder-1 entry. I'm not sure why this got added without the
migration happening - it may have been due to me running an import
using import_export before installing the reorder extension.
Jonathan.
On 30 Jul 2009, at 09:33, Jonathan Batchelor wrote:
(changed subject to make more relevant)
Ok, thanks Mamed.
I was wondering though if this is a bug in the Rakefile or
somewhere else? I'd be willing to try and fix it and submit the
patch/update as necessary (perhaps a good way to learn more about
migrations and git etc!).
Any clues?
Jonathan.
On 29 Jul 2009, at 18:42, Mamed Mamedov wrote:
Hi!
It was the same problem with *reorder* extension, after
installation success
the migration task does nothing, therefore the /admin/pages page
gives HTTP
500 error.
That is what I have done to make reorder extension complete it's
installation process:
selene# cat vendor/extensions/reorder/db/migrate/
01_add_position_to_pages.rb
class AddPositionToPages < ActiveRecord::Migration
def self.up
add_column :pages, :position, :integer
Page.reset_column_information
say_with_time("Putting all pages in a default order...") do
ActiveRecord::Base.record_timestamps = false
Page.find_all_by_parent_id(nil).each do |p|
put_children_into_list(p)
end
ActiveRecord::Base.record_timestamps = true
end
end
def self.down
remove_column :pages, :position
end
def self.put_children_into_list(page)
page.children.find(:all, :order => "title asc").each_with_index
do |pg,
idx|
pg.update_attribute('position', idx + 1)
put_children_into_list(pg)
end
end
end
Then, run these:
selene# ./script/console
Loading development environment (Rails 2.1.2)
And copy the contents of file shown before to console and press
Enter.
Finally, type this: AddPositionToPages.up(); and then press
Enter :) Voila!
Hope this will help you!
________________
Regards,
Mamed Mamedov
Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html
>
- "I'm willing to admit that I may not always be right, but I am
never
wrong."
2009/7/29 Jonathan Batchelor <j...@atuin.co.uk>
Thanks - seems to be working fine now!
I am however having issues with the reorder plugin.
When I install it, it fails to insert the "position" field into
the pages
table. Possibly because I have no pages in my site yet (I want to
use
import_export to grab them from a development install I have
elsewhere) -
has anyone else seen this issue? I think the migration assumes
that there
will be a page with no parent - but being fairly new to rails,
I'm not sure
if that means the migration gets rolled back in the install or
not... Then
again, I don't see the "say_with_time("Putting all pages in a
default
order...") bit printed out either - perhaps it goes to a log
somewhere
instead.
Thanks for all your help!
Jonathan.
On 28 Jul 2009, at 19:35, john muhl wrote:
i've just fixed this, update ray and you shouldn't run into that
anymore.
On Tue, Jul 28, 2009 at 5:25 AM, Jonathan Batchelor<j...@atuin.co.uk
>
wrote:
I've been playing about with Radiant for a few days now and am
really
liking it's simplicity and flexibility.
After installing on my MacBook and beginning some developmet I
want to
install on my Dreamhost account. I have been migrated to a
newer server
by
Dreamhost and have Radiant 0.8.0 working now.
I started to install install extensions and took the advice on
the wiki
page to use ray as it will automatically reload Passenger for
me. However
although the script/extensions install command works fine, as
did setting
the config for ray using rake ray:setup:restart
server=passenger, when I
come to install an extension it does not work. I have included
the
--trace
output below - can anyone help?
Thanks,
Jonathan.
$ rake production ray:extension:install name=dashboard --trace
(in /home/xxxx/xxxx_radiant)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke ray:extension:install (first_time)
** Execute ray:extension:install
rake aborted!
undefined method `strip' for nil:NilClass
/home/xxxx/xxxx_radiant/vendor/extensions/ray/lib/tasks/
ray_extension_tasks.rake:807:in
`get_download_preference'
/home/xxxx/xxxx_radiant/vendor/extensions/ray/lib/tasks/
ray_extension_tasks.rake:151:in
`install_extension'
/home/xxxx/xxxx_radiant/vendor/extensions/ray/lib/tasks/
ray_extension_tasks.rake:20
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/home/xxxx/.gems/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/xxxx/.gems/gems/rake-0.8.7/bin/rake:31
/home/xxxx/.gems/bin/rake:19:in `load'
/home/xxxx/.gems/bin/rake:19
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant