ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Config with safecracker and msm - php error

February 16, 2012 10:20am

Subscribe [1]
  • #1 / Feb 16, 2012 10:20am

    kellypacker

    138 posts

    I just added a safecracker form to a site running:
    ee 2.4.0 20120123
    msm 2.1.2 Build: 20120123
    safecracker 2.1

    I get a bunch of these errors in the template:
    A PHP ERROR WAS ENCOUNTERED
    Severity: Notice
    Message: Undefined index: site_url
    Filename: config/config.php
    Line Number: 154

    In the index.php of site1 I have this set:
    $assign_to_config[‘site_url’] = ‘http://site1.com’;

    In the index.php of site2 I have this set:
    $assign_to_config[‘site_url’] = ‘http://site2.com’;

    The first instance of the php error is referring to this line in the config:
    $config[‘avatar_url’] = $config[‘site_url’].”/images/avatars/”;

    The error says the variable is not set in the config, which it isn’t because it’s set in the index.php of each site. Any advice on this? Thanks.

  • #2 / Feb 17, 2012 2:29pm

    Dan Decker

    7338 posts

    Hi kellypacker,

    Let’s see if we can get this behaving properly for you!

    If you change the item in your config.php to reference the value as assigned in index.php, does the error subside?

    $config['avatar_url'] = $assign_to_config['site_url'].'/images/avatars/';

    $assign_to_config works “on the fly” while $config is intended to “nail it down”. Ultimately, they are 2 different array()s.

    Give that a go and let me know what you find out.

    Cheers,

     

  • #3 / Feb 17, 2012 4:38pm

    kellypacker

    138 posts

    Hi Dan,

    Thanks for the reply. Hm now it gives me this error:

    A PHP ERROR WAS ENCOUNTERED
    Severity: Notice
    Message: Undefined variable: assign_to_config
    Filename: config/config.php
    Line Number: 154

  • #4 / Feb 22, 2012 4:50pm

    Dan Decker

    7338 posts

    Hi Kelly,

    I wasn’t able to trigger the same error, but when I checked Control Panel, it didn’t include the URL to the site.

    Can you tell me what it is you want to be able to do, and I should be able to provide you with a way to do it.

    Cheers,

  • #5 / Feb 24, 2012 11:41am

    kellypacker

    138 posts

    Hi Dan,

    I got around it by replacing the problem variables with global variables I created for the url and path from my main MSM site. I don’t need separate captcha, avatar folders, etc. So this will work for me.

    It’s just strange because the MSM instructions say to use the $assign_to_config variable, and then it throws that error. But if I am the only one having the issue and you can’t recreate it, then it’s not worth trying to get a fix for it.

    Thanks for your help. Kelly

  • #6 / Feb 24, 2012 8:16pm

    Sean C. Smith

    3818 posts

    Kelly,

    Glad to see you found a solution that works for you. do post again if you need further assistance.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases