We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    ScottyDelicious Reply #1, 20 years ago
    I am developing a module, trying to use $modx->config[’base_path’] to load a config file.
    the module executes, but generates a runtime error
    in the system events log it says:
    Undefined variable: base_path


    is there a different call I should use. I tried $modx->config[’site_url’] and $modx->config{’base_url’].
    neither of those calls generate a runtime error, but both generate PHP errors relating to the file not existing.

    I am developing under MODx 0.9.5 beta (rev 1392).

    If this is a bug under that revision, I will upgrade, but I would rather not potentially add more problems at this point.
    I am sure I am just missing something simple.

    -sD-
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 26435
      • 1,193 Posts
      ScottyDelicious Reply #2, 20 years ago
      I just tested on a local install of MODx 0.9.5 beta 3 (rev 1533) which produced the same runtime error:
      sdTestModule - Module runtime error:
      
      An error occurred while loading the module. Please see the event log.


      the event log shows the same:
       Error
      
      Event Id: 	1 	Source: 	sdTestModule - Module
       
      Date: 	30-Sep-2006 02:38 PM 	User: 	ScottyDelicious
       
      
      Undefined variable: base_path


      The module executes correctly so far, it just generates this error. I am not sure why because the undefined variable "base_path" gets the right file? either this is weird or I am dumb (probably option B).

      any ideas?

      -sD-
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 26435
        • 1,193 Posts
        ScottyDelicious Reply #3, 20 years ago
        Undefined variable base_path was a variable in the config.inc.php file that was being loaded.
        all I had to do was define it in my module.

        -sD-
          Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
          All of the above... in no specific order.


          I send pointless little messages