Import_export errors in importing users

Hi there,

I’m trying to use import_export (a really useful extension if I could
get it
to work)and have seen that a number of people have experienced an error
similar to this one, regarding importing users:

Creating Users…FAILED
rake aborted!
User expected, got Fixnum

I’ve read Luca Erzegovesi’s post on the subject:
http://lists.radiantcms.org/pipermail/radiant/2007-June/005083.html

but his workaround doesn’t work for me. Is there any plan to fix this
bug or
should we look for alternatives to the import_export extension?

Thanks
Ramie

Here’s the full trace after successfuly exporting the data, using the
command:

$ rake --trace production db:import TEMPLATE=export.tml

** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke db:import (first_time)
** Invoke db:remigrate (first_time)
** Invoke environment
** Execute db:remigrate
This task will destroy any data in the database. Are you sure you want
to
continue? [yn] y
== AddOptimisticLocking: reverting

– remove_column(:pages, :lock_version)
-> 0.0029s
– remove_column(:layouts, :lock_version)
-> 0.0023s
– remove_column(:snippets, :lock_version)
-> 0.0020s
– remove_column(:users, :lock_version)
-> 0.0018s
== AddOptimisticLocking: reverted (0.0094s)

== RenameConfigDefaultPartsKey: reverting

== RenameConfigDefaultPartsKey: reverted (0.0081s)

== AddNotesFieldToUser: reverting

– remove_column(“users”, “notes”)
-> 0.0016s
== AddNotesFieldToUser: reverted (0.0018s)

== CreateExtensionMeta: reverting

– drop_table(“extension_meta”)
-> 0.0046s
== CreateExtensionMeta: reverted (0.0048s)

== RenameTypeColumnOnPageToClassName: reverting

– rename_column(“pages”, “class_name”, “type”)
-> 0.0014s
== RenameTypeColumnOnPageToClassName: reverted (0.0016s)

== MergeBehaviorsAndPages: reverting

– rename_column(:pages, :type, :behavior_id)
-> 0.0013s
== MergeBehaviorsAndPages: converting class names back to behavior names

== MergeBehaviorsAndPages: reverted (0.0042s)

== AddContentTypeFieldToLayout: reverting

– remove_column(“layouts”, “content_type”)
-> 0.0016s
== AddContentTypeFieldToLayout: reverted (0.0020s)

== AddVirtualColumnToPageAgain: reverting

– remove_column(“pages”, “virtual”)
-> 0.0019s
== AddVirtualColumnToPageAgain: reverted (0.0021s)

== RemoveVirtualColumnFromPage: reverting

– add_column(“pages”, “virtual”, :boolean, {:default=>false,
:null=>false})
-> 0.0058s
== RemoveVirtualColumnFromPage: reverted (0.0060s)

== IntegerColumnsToBoolean: reverting

== IntegerColumnsToBoolean: saving User data

– remove_column(“users”, “admin”)
-> 0.0023s
– add_column(“users”, “admin”, :integer, {:default=>0, :null=>false,
:limit=>1})
-> 0.0062s
== IntegerColumnsToBoolean: restoring User data

== IntegerColumnsToBoolean: saving User data

– remove_column(“users”, “developer”)
-> 0.0025s
– add_column(“users”, “developer”, :integer, {:default=>0,
:null=>false, :limit=>1})
-> 0.0059s
== IntegerColumnsToBoolean: restoring User data

== IntegerColumnsToBoolean: reverted (0.0608s)

== AddVirtualColumnToPage: reverting

– remove_column(“pages”, “virtual”)
-> 0.0019s
== AddVirtualColumnToPage: reverted (0.0020s)

== RenameFilterColumn: reverting

– rename_column(:page_parts, :filter_id, :filter)
-> 0.0013s
– rename_column(:snippets, :filter_id, :filter)
-> 0.0014s
== RenameFilterColumn: reverted (0.0031s)

== RenameBehaviorColumn: reverting

– rename_column(:pages, :behavior_id, :behavior)
-> 0.0013s
== RenameBehaviorColumn: reverted (0.0014s)

== InsertInitialData: reverting

== InsertInitialData: reverted (0.0000s)

== CreateRadiantTables: reverting

– drop_table(“pages”)
-> 0.0041s
– drop_table(“page_parts”)
-> 0.0047s
– drop_table(“snippets”)
-> 0.0059s
– drop_table(“layouts”)
-> 0.0050s
– drop_table(“users”)
-> 0.0071s
– drop_table(“config”)
-> 0.0047s
== CreateRadiantTables: reverted (0.0326s)

** Invoke db:migrate (first_time)
** Invoke environment
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
== CreateRadiantTables: migrating

– create_table(“config”, {:force=>true})
-> 0.0071s
– add_index(“config”, [“key”], {:unique=>true, :name=>“key”})
-> 0.0036s
– create_table(“pages”, {:force=>true})
-> 0.0097s
– create_table(“page_parts”, {:force=>true})
-> 0.0122s
– create_table(“snippets”, {:force=>true})
-> 0.0120s
– add_index(“snippets”, [“name”], {:unique=>true, :name=>“name”})
-> 0.0039s
– create_table(“layouts”, {:force=>true})
-> 0.0098s
– create_table(“users”, {:force=>true})
-> 0.0079s
– add_index(“users”, [“login”], {:unique=>true, :name=>“login”})
-> 0.0029s
== CreateRadiantTables: migrated (0.0715s)

== InsertInitialData: migrating

== InsertInitialData: migrated (0.0000s)

== RenameBehaviorColumn: migrating

– rename_column(:pages, :behavior, :behavior_id)
-> 0.0013s
== RenameBehaviorColumn: migrated (0.0015s)

== RenameFilterColumn: migrating

– rename_column(:page_parts, :filter, :filter_id)
-> 0.0013s
– rename_column(:snippets, :filter, :filter_id)
-> 0.0015s
== RenameFilterColumn: migrated (0.0031s)

== AddVirtualColumnToPage: migrating

– add_column(“pages”, “virtual”, :boolean, {:default=>false,
:null=>false})
-> 0.0060s
== AddVirtualColumnToPage: migrated (0.0061s)

== IntegerColumnsToBoolean: migrating

== IntegerColumnsToBoolean: saving User data

– remove_column(“users”, “admin”)
-> 0.0019s
– add_column(“users”, “admin”, :boolean, {:default=>false,
:null=>false})
-> 0.0057s
== IntegerColumnsToBoolean: restoring User data

== IntegerColumnsToBoolean: saving User data

– remove_column(“users”, “developer”)
-> 0.0019s
– add_column(“users”, “developer”, :boolean, {:default=>false,
:null=>false})
-> 0.0051s
== IntegerColumnsToBoolean: restoring User data

== IntegerColumnsToBoolean: migrated (0.0199s)

== RemoveVirtualColumnFromPage: migrating

– remove_column(“pages”, “virtual”)
-> 0.0023s
== RemoveVirtualColumnFromPage: migrated (0.0024s)

== AddVirtualColumnToPageAgain: migrating

– add_column(“pages”, “virtual”, :boolean, {:default=>false,
:null=>false})
-> 0.0053s
== AddVirtualColumnToPageAgain: migrated (0.0055s)

== AddContentTypeFieldToLayout: migrating

– add_column(“layouts”, “content_type”, :string, {:limit=>40})
-> 0.0016s
== AddContentTypeFieldToLayout: migrated (0.0017s)

== MergeBehaviorsAndPages: migrating

== MergeBehaviorsAndPages: converting behavior names to class names

– rename_column(:pages, :behavior_id, :type)
-> 0.0013s
== MergeBehaviorsAndPages: migrated (0.0034s)

== RenameTypeColumnOnPageToClassName: migrating

– rename_column(“pages”, “type”, “class_name”)
-> 0.0015s
== RenameTypeColumnOnPageToClassName: migrated (0.0017s)

== CreateExtensionMeta: migrating

– create_table(“extension_meta”, {:force=>true})
-> 0.0384s
== CreateExtensionMeta: migrated (0.0386s)

== AddNotesFieldToUser: migrating

– add_column(“users”, “notes”, :text)
-> 0.0045s
== AddNotesFieldToUser: migrated (0.0047s)

== RenameConfigDefaultPartsKey: migrating

== RenameConfigDefaultPartsKey: migrated (0.0020s)

== AddOptimisticLocking: migrating

– add_column(:pages, :lock_version, :integer, {:default=>0})
-> 0.0036s
– add_column(:layouts, :lock_version, :integer, {:default=>0})
-> 0.0043s
– add_column(:snippets, :lock_version, :integer, {:default=>0})
-> 0.0032s
– add_column(:users, :lock_version, :integer, {:default=>0})
-> 0.0036s
== AddOptimisticLocking: migrated (0.0156s)

** Invoke db:schema:dump
** Invoke db:schema:dump
** Execute db:import

Creating Users…FAILED
rake aborted!
User expected, got Fixnum
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li
b/active_record/associations/association_proxy.rb:148:in
raise_on_type_mismatch' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li b/active_record/associations/belongs_to_association.rb:22:inreplace’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li
b/active_record/associations.rb:908:in
created_by=' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li b/active_record/base.rb:1672:insend’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li
b/active_record/base.rb:1672:in
attributes=' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li b/active_record/base.rb:1671:ineach’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li
b/active_record/base.rb:1671:in
attributes=' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li b/active_record/base.rb:1505:ininitialize_without_callbacks’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/li
b/active_record/callbacks.rb:225:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:144:innew’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:144:in
create_records' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:143:ineach’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:143:in
create_records' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:204:instep’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:142:in
create_records' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:191:infeedback’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:138:in
create_records' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:137:ineach’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/setup.rb:137:in
create_records' /Users/ramie/Documents/work/SVNProjectsRoot/abg-cms/config/../vendor/extensi ons/import_export/lib/tasks/import_export_extension_tasks.rake:23:insend’
/Users/ramie/Documents/work/SVNProjectsRoot/abg-cms/config/…/vendor/extensi
ons/import_export/lib/tasks/import_export_extension_tasks.rake:23
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in call' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:inexecute’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:inexecute’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:intop_level’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:intop_level’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:intop_level’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:instandard_exception_handling’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/local/bin/rake:16:inload’
/usr/local/bin/rake:16

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs