rsolr-ext icon indicating copy to clipboard operation
rsolr-ext copied to clipboard

question on deprecation re Rsolr::Ext.connect

Open jrochkind opened this issue 13 years ago • 4 comments

When starting up a Blacklight app that uses RSolr::Ext, I get this:

"DEPRECATION WARNING: Future versions of RSolr::Ext will require initialization via RSolr::Ext.connect."

Can you explain what the deprecated behavior is exactly, and what the non-deprecated alternative is? How should I fix Blacklight code to not trigger this deprecation warning (and more importantly, be future-forward and not be using deprecated behavior).

Thanks.

jrochkind avatar Jun 06 '11 20:06 jrochkind

Hey Jonathan. When you require rsolr-ext, it automatically overrides code in rsolr. I think being explicit about using rsolr-ext functionality is best. The change makes it so that rsolr-ext does not override rsolr when loading the library. Using RSolr::Ext.connect fixes this.

You don't have to do anything in Blacklight, it's already there:

https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight.rb#L62

mwmitchell avatar Jun 06 '11 21:06 mwmitchell

Hmm, something does not compute.

If it's already there, why am I getting the deprecation warning on boot? Are you saying that I may not be using deprecated behavior, but I'm getting a deprecation warning anyway?

If I'm getting a deprecation warning, my assumption is I'm (or BL code) is doing something deprecated. If BL code is doing somethign deprecated, I want to figure out what and fix it so it no longer is. But I'm stuck here, I don't know where to start to figure out what it's doing that's deprecated and how to fix it. Any additional hints?

On Mon, Jun 6, 2011 at 5:27 PM, mwmitchell [email protected] wrote:

Hey Jonathan. When you require rsolr-ext, it automatically overrides code in rsolr. I think being explicit about using rsolr-ext functionality is best. The change makes it so that rsolr-ext does not override rsolr when loading the library. Using RSolr::Ext.connect fixes this.

You don't have to do anything in Blacklight, it's already there:

https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight.rb#L62

Reply to this email directly or view it on GitHub: https://github.com/mwmitchell/rsolr-ext/issues/15#comment_1312021

jrochkind avatar Jun 06 '11 22:06 jrochkind

Hmm, I was wrong about this. I'm removing the warning. The only thing RSolr::Ext#connect is doing is wrapping RSolr#connect. The thing I don't like is the auto-mixin when rsolr-ext is loaded. But if you're loading it, you want to use it.

mwmitchell avatar Jun 07 '11 03:06 mwmitchell

Awesome, thanks. I don't entirely get the thing you don't like, but if
you document somewhere (the wiki?) "Don't do it like this, instead do
it like that", then I'll make sure any code I work on does it how you
suggest, if feasible.

(In upgrading my app from rails2/blacklight2 to blacklight/rails3, I
need to pay a lot of attention to deprecation warnings to get things
set up for, say, Rails 3.1. So if I see a deprecation warning, say
when running my test suite, Ii change my code to do it non-deprecated.
So it's important I don't get deprecation warnings unless i'm doing
something deprecated, so I can know when I've succesfully fixed all
deprecated uses )

On Jun 6, 2011, at 11:06 PM, mwmitchell wrote:

Hmm, I was wrong about this. I'm removing the warning. The only
thing RSolr::Ext#connect is doing is wrapping RSolr#connect. The
thing I don't like is the auto-mixin when rsolr-ext is loaded. But
if you're loading it, you want to use it.

Reply to this email directly or view it on GitHub: https://github.com/mwmitchell/rsolr-ext/issues/15#comment_1313338

jrochkind avatar Jun 07 '11 03:06 jrochkind