Announcement

Collapse
No announcement yet.

problem with file paths under MM9

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    problem with file paths under MM9

    Hi folks,

    Some of my modules use the value of g.Merchant_Version to construct file paths such as ".../5.00/modules/..." This has always worked fine, all the way back to v4 I think. But some of my clients are now having a problem because their stores have been upgraded to 9.000, but all the scripts are still in a folder named "5.00." This breaks the module, because it's generating paths of the form ".../9.000/modules/..." which doesn't exist.

    Does anyone have a good fix for this? I took a quick look at the Domain Settings, and there doesn't seem to be anything in there that a module can use to identify this situation. It looks like I have to either hard-code the module to try both places, or else create a new admin setting where users can manually enter the correct folder name. But I must be missing something. I presume that, when a user adds a module to one of these stores, it goes into the correct folder. How does the store know where to put it?

    Thanks, and Happy Thanksgiving & Black Friday to all! --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    Re: problem with file paths under MM9

    Use g.Version_Path instead. It has been available since 4.x and returns the correct directory in all versions of the software.

    Edit: To be clear, g.Version_Path will still return "5.00/" under MM9, to address exactly the issue you're having.
    Last edited by burch; 11-26-14, 10:21 AM.

    Comment


      #3
      Re: problem with file paths under MM9

      Yep, that did the trick. 4.x, really? Makes me want to sit down with a copy of the LSK, and read it ...

      Thanks for the quick reply!
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment

      Working...
      X