Wordpress2 Conversion: "...uninitialized constant TestReques

Hi All

I’d be grateful for some help on this as this is the only stumbling
block I’ve got before a full switch over to Typo. When I run my
“wordpress2.rb” conversion script I get the following output:

Code:

Creating Blog…
Converting 0 users…
Converting 104 entries…
…/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:123:in
const_missing': uninitialized constant TestRequest (NameError) from ../../config/../app/models/blog.rb:183:inrequest’
from …/…/config/…/app/models/blog.rb:156:in url_for' from ../../config/../app/models/blog.rb:168:inarticle_url’
from …/…/config/…/app/models/article.rb:26:in location' from ../../config/../app/models/article.rb:40:inreally_send_pings’
from
…/…/config/…/app/models/content_state/just_published.rb:44:in
send_pings' from ../../config/../app/models/article.rb:67:insend_pings’
from …/…/config/…/app/models/web_notifier.rb:5:in
after_save' ... 15 levels... from wordpress2.rb:27:ininitialize’
from wordpress2.rb:285:in execute_without_timestamps' from wordpress2.rb:23:ininitialize’
from wordpress2.rb:291

Google turns up no answers so I’d be very grateful for your input!

On 29/07/2006, at 1:52 AM, Doug B. wrote:

lib/active_support/dependencies.rb:123:in
`const_missing’: uninitialized constant TestRequest (NameError)

Hi Doug,

I posted a patch for this here:

http://typoforums.org/index.php/topic,165.msg614.html#msg614

On 7/28/06, Alastair R. [email protected] wrote:

I posted a patch for this here:
http://typoforums.org/index.php/topic,165.msg614.html#msg614

Doh! I ran into this when updating the script for WordPress 2 and then
promptly forgot about it after I got the conversion working. FWIW, my
fix is the same as yours except that I had

articleurl ||= location(nil, false)

instead of

articleurl = location(nil, false) unless articleurl

Gotta love Ruby! Anyway, I submitted the fix as a patch to the Typo
Trac. See http://www.typosphere.org/trac/ticket/1053.

Phil

Ok, I committed your patch in [1186]. Thanks.

Phillip T. wrote:

instead of

articleurl = location(nil, false) unless articleurl

Gotta love Ruby! Anyway, I submitted the fix as a patch to the Typo
Trac. See http://www.typosphere.org/trac/ticket/1053.

Phil


Kevin B.
http://kevin.sb.org
[email protected]
http://www.tildesoft.com

Thanks Alistair and Phil. Much appreciate your help. Its now working
like a charm so I shall get on with the process of converting
entirely.

All the best.

Doug

On 29/07/2006, at 7:11 PM, Doug B. wrote:

Thanks Alistair and Phil. Much appreciate your help. Its now working
like a charm so I shall get on with the process of converting
entirely.

Doug,

Good luck. I finally made the switch from Wordpress to Typo a few
days ago. Still coming to grips with it, but mostly very successful.

One other change that I had to make was to fixup some numeric XML
entities (like “ሴ”) in article titles.

Set
$KCODE=“u”

Then for each article:
a.title = CGI::unescapeHTML a.title

It seems that Typo escapes the characters in the article titles, but
Wordpress doesn’t. I am probably the only person in the world to use
these numeric entities so I haven’t bothered submitting a patch.
Quite happy to, if anyone thinks it’s worthwhile.

Other than that the conversion process worked great.

BTW I can also recommend my hosting provider, a2hosting. They support
rails and even have a knowledgebase article for Typo (https://
support.a2hosting.com/index.php?
_m=knowledgebase&_a=viewarticle&kbarticleid=378&nav=0,23,36)

Again, good luck.

Doug,
This is just a shot in the dark. Are you sure that you are looking in
the right database? Maybe you are looking in the production database
and the data is in the development database. I have been bitten by
this myself a few times. I am pretty sure that the script would squawk
if there was a problem writing the data to the database.

Good luck,
Phil

Hi Alistair.

I sppoke to soon. :frowning:

I ran the conversion after making the patch with everything appearing
to work fine. It runs through “converting entries…” and finishes.
However, when I check the typo DB there’s been no import. No articles
showing up in the backend or in the database itself.

Bit awkward as there’s no error message to give a hint about it

Don’t suppose you have any ideas do you?

All the best.

Doug

Hi Phil

You’re absolutely right!! How could I be so blind.

Thanks again - you’re very patient.

Doug

Hi All,

I stumbled upon this bug, when i was trying to write my own sidebar
plugin.

Whenever i try to add or remove items to sidebar by dragging the stuff
to
the active region, i get error:

NoMethodError (You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.reject):
/app/controllers/admin/sidebar_controller.rb:48:in remove' /vendor/rails/actionpack/lib/action_controller/base.rb:910:inperform_action_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:381:inprocess_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:377:in
`process_without_session_management_support’

/vendor/rails/actionpack/lib/action_controller/session_management.rb:117:in
process' /vendor/rails/railties/lib/dispatcher.rb:38:indispatch’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/rails.rb:73:in
process' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:551:inprocess_client’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:550:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:625:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:956:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:955:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:127:in
`run’

/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in
`run’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:235
/usr/bin/mongrel_rails:18

[4;35;1mUser Columns (0.001528) [0m [0mSHOW FIELDS FROM users [0m
Rendering
/home/hemant/public_html/analyst_blog/config/…/vendor/rails/actionpack/lib/
action_controller/templates/rescues/layout.rhtml (500 Internal Error)

And the problem is with the line:

activemap = flash[:sidebars].inject({}) do |h, sb_id|
sb = Sidebar.find(sb_id.to_i)
sb ? h.merge({ sb.html_id => sb_id }) : h
end

while we assign the active plugins to flash[:sidebars] in index action,
but
they are replaced or lost in set_active method and hence the bug.
It may be something to do with the way mongrel handles sessions alos,
but
may be.

It looks a bug to me, right now.

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