1

I'm using FocusLab MasterConfig to set my upload preferences but strangely only the name of the Upload preference gets set by my code. Here is the code in config.master.php

$resources_folder = 'resources';
$resources_path = $base_path . DIRECTORY_SEPARATOR . $resources_folder;
$resources_url  = $base_url . '/' . $resources_folder;

$env_config['upload_preferences'] = array(
    7 => array(
        'name'        => 'Landing Page Banners',
        'server_path' => $resources_path . '/images/banners/landing/',
        'url'         => $images_url  . '/images/banners/landing/'
    ),
    8 => array(
        'name'        => 'Home Page Banners',
        'server_path' => $resources_path . '/images/banners/home/',
        'url'         => $images_url  . '/images/banners/home/'
    ));

Anyone know why the server_path and url (which are the important values) have no effect on the values shown in the CP?

  • maybe change your 'url' => $images_url . '/images/banners/landing/' to 'url' => $protocol . $_SERVER['HTTP_HOST'] . '/images/banners/landing/' – Jelle Dijkstra Oct 5 '16 at 14:58
  • That makes no difference. The url is totally ignored. This worked fine in the old ee version 2 configs. N.B. I am using the ee3 version of masterConfig – dorothy Dorothy Oct 10 '16 at 16:05
0

Did you test out an upload to your directories? It looks like only the name is read from the config variable, while the path / url in the CP will show what's in the database. But in use, reading and uploads to the file directories should use what you have in the Master Config settings -- overriding what's in the database.

| improve this answer | |
  • I've tested my upload directories and they are set correctly. – dorothy Dorothy Oct 10 '16 at 16:03
  • So uploading a file works successfully in the ee control panel? – Romans-8---31-39 Oct 11 '16 at 0:22
  • Yes it did. I have 3 projects now with the same issue. Beginning to believe that this is a bug. Do you have this problem with any ee3 projects? – dorothy Dorothy Oct 12 '16 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.