It looks like the problem with the database_form extension is with the
redirect. I don't know exactly how to fix it or even how to fully
explain why it's not working. But, I did find what looks like a fix on
the radiantcms-dev google group.

This is where things are going wrong in the extension (lines 22-26) of
the extension:
~~~~
if save_form and redirect_to
  response.redirect(redirect_to)
else
  super(request, response) 
end
~~~~

This is the fix that Charlie Robbins suggested
(link:
http://groups.google.com/group/radiantcms-dev/browse_thread/thread/783c07a89beafcf5):
~~~~
#Trim the leading / off the slug 
redirect_to = redirect_to.gsub(/^\//, '') 
@response.body = redirect_to 
@response.body = Page.find(:first, :conditions => ["slug = ?", 
redirect_to]).render 
~~~~

Now cannot really make heads or tails of this. Can anybody explain what
is happening here? The author of the extension wrote in the ReadMe that
the extension worked with Radiant 0.6.4. Could there be something in
Radiant that changed to break this extension or was it not properly
written to begin with? Not trying to step on any toes, but it seems like
this extension would be more sought after and it would be nice to see it
working properly.

When I substitute the "fixed" code from Charlie, I get this error:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.render

Any insight would be appreciated.


Thanks,

Nate

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to