[Radiant] Fails when using Gallery in brand new Radiant setup
Thomas Watson Steen
twa at 3dbyggeri.dk
Mon May 19 10:24:37 CDT 2008
I'm having a problem with the Gallery extension:
When setting up a new site most deployment related rake tasks stop
working if your Radiant app contains the Gallery extension.
This happends because of the first statement in the GalleryItem class
(vendor/extensions/gallery/app/models/gallery_item.rb):
> has_attachment :storage => :file_system,
> :path_prefix => Radiant::Config["gallery.path_prefix"],
> :processor => Radiant::Config["gallery.processor"]
As you can see in the above code, the Gallery extension uses the
has_attachment plugin. When setting up the ruby environment the
gallery_item.rb file is loaded and the above code is executed. When
executed it makes a call to the "[]" method in Radiants config.rb
which in turn tries to find the key "gallery.path_prefix" in the
database by calling "find_by_key(key)". This fails with the message:
> Mysql::Error: Table 'radiant.config' doesn't exist: SHOW FIELDS
> FROM `config`
This is because the config table has not yet been created (remember
we are setting up a brand new site and have not run the db:bootstrap
rake task yet).
Whos fault is this?
Is it the Gallery extension that must check to see if the config
table exists? Or is it the config handler in Radiant that should make
this check?
I'll happely fix and submit a patch for this "bug", but need to hear
what you guys think is the best solution.
/watson
More information about the Radiant
mailing list