Hello Jeff,
Got a similar suggestion from IVO. Thanks to you both. This does lead
me to an important question.
Does this problem exist in the rest of Merchant? My particular quest
deals only in the admin for using these functions. It will likely be
that only one admin session is ever running for a particular store.
However, I like to heed good advice and will write my own search
routine. However, what about the rest of MM? Many functions and
modules open and close many databases and indexes. How does this idea
of danger using MM functions from db.mv apply to the rest of MM like
opening customer, orders, etc? Is there dangers of MM itself leaving
itself on the wrong records, indexes, etc?
BTW: I am not really worried about this, but the question is there and
I am very interested in the line of thought regarding what the dangers
really encompass.
TIA,
Scott
IDS
Sunday, October 10, 2004, 10:15:55 AM, you wrote:
j4c> The easiest safe way to do it is to Open the modules table, and
j4c> store modules table with new aliases with no indexes and simply
j4c> use filters to find what you want. On small record sets like the
j4c> size of the modules table the Mvfilter is so fast that you would
j4c> be really hard pressed to notice it wasn't an indexed search.
j4c> - Jeff Huber
j4c> President 4TheBest eCommerce Solutions
j4c> http://4TheBest.com
j4c> [email protected]
j4c> Office: 760-742-1469
j4c> Cell: 760-445-8454
j4c> -----Original Message-----
j4c> From: Scott Shepard [mailto:[email protected]]
j4c> Sent: Sunday, October 10, 2004 1:04 AM
j4c> To: [email protected]
j4c> Cc: [email protected]
j4c> Subject: Re[4]: [mrc] need to know if a module is installed?
j4c> Hello jeff,
j4c> Thanks for your input. This is helpful. I can imagine how some
j4c> recursive loop of something exotic can get started.
j4c> Might you have any ideas? Should I write a function to search the
j4c> modules db directly -- creating my own indexes, and other such
j4c> steps?
j4c> TIA,
j4c> Scott
j4c> IDS
j4c> Saturday, October 9, 2004, 11:46:27 PM, you wrote:
j4c>> Scott,
j4c>> Be very careful about calling those functions from within a
j4c>> module. All sorts of very nasty and hard to track down bad
j4c> things
j4c>> can happen if you for example are inside a system extension
j4c>> module and call to see if module 'abc' is installed in the
j4c> domain
j4c>> and the store. Not the least of which is that the wrong
j4c> index may
j4c>> end up being left open and the main software may end up
j4c> calling
j4c>> some random module next and trying to call whatever system
j4c>> extension function it just called in yours. And in fact your
j4c> own
j4c>> module can even end up getting called twice in a row.
j4c>> - Jeff Huber
j4c>> President 4TheBest eCommerce Solutions
j4c>> http://4TheBest.com
j4c>> [email protected]
j4c>> Office: 760-742-1469
j4c>> Cell: 760-445-8454
j4c>> -----Original Message-----
j4c>> From: [email protected]
j4c>> [mailto:[email protected]] On Behalf Of Scott
j4c>> Shepard
j4c>> Sent: Friday, October 08, 2004 10:20 PM
j4c>> To: [email protected]
j4c>> Subject: Fwd: Re[2]: [mrc] need to know if a module is
j4c> installed?
j4c>> Rethinking what my question is, because the docs aren't very
j4c>> good. I
j4c>> think what I'm really wanting to know is what the functions
j4c> do.
j4c>> <MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{
j4c>> Module_Find_Code( g.Module_Code ) }">
j4c>> It think it will really be enough to know if "l.ok" is true
j4c> or
j4c>> false.
j4c>> I was wondering how Module_Find_Code works.
j4c>> When realizing this I just found that I could go to see the
j4c>> function
j4c>> in "db.mv."
j4c>> No Harm Done Then! Question and problem solved!
j4c>> Thanks,
j4c>> Scott
j4c>> IDS
j4c>> This is a forwarded message
j4c>> From: Scott Shepard <[email protected]>
j4c>> To: [email protected]
j4c>> Date: Friday, October 8, 2004, 9:57:36 PM
j4c>> Subject: [mrc] need to know if a module is installed?
j4c>> ===8<==============Original message text===============
j4c>> Thanks Susan. Saw these in the docs at Miva.com, but there's
j4c> no
j4c>> examples or
j4c>> explanation of implementation. When you look at some MM
j4c> code, it
j4c>> isn't
j4c>> very efficient use for what I need to accomplish.
j4c>> I was hoping someone could share an example illustration the
j4c>> method. I
j4c>> probably presuming it's more complicated than it really is.
j4c>> TIA,
j4c>> Scott
j4c>> IDS
j4c>> Friday, October 8, 2004, 6:07:13 AM, you wrote:
SP>>> For the domain:
SP>>> Module_Find_Code('MODCODE')
SP>>> You may also then want to check Modules.d.active to
j4c> determine
j4c>> if the module
SP>>> is active or not
SP>>> For the store:
SP>>> StoreModule_Find_ID(Modules.d.id) - assuming you've already
j4c>> done the above
SP>>> and therefore the Modules record pointer is on the right row
SP>>> HTH, Susan
SP>>> Susan Petracco
SP>>> [email protected]
SP>>> NetBlazon
SP>>> E-Business for Every Business
>>>> -----Original Message-----
>>>> From: [email protected]
>>>> [mailto:[email protected]] On Behalf Of Scott
j4c>> Shepard
>>>> Sent: Friday, October 08, 2004 5:55 AM
>>>> To: [email protected]
>>>> Subject: [mrc] need to know if a module is installed?
>>>>
>>>> Hello merchant-coders,
>>>>
>>>> What would be good method to figure out if a particular
j4c> module
j4c>> is
>>>> installed in the domain and/or the store? Is there a function
j4c>> already
>>>> for this? I'm working on a custom mod that needs to know if
j4c>> certain
>>>> mods are already installed to enable features of the custom
j4c>> module.
>>>> These mods are not required for the custom module and user
j4c>> input is
>>>> not available/allowed in this instance.
>>>>
>>>> --
>>>> Best regards,
>>>> Scott
>>>> mailto:[email protected]
>>>>
>>>>
>>>>