0

We've just updated to the latest version of Assets v2.0.4 and have noticed that there's two of every upload preference displaying in the side column. We're using the Focus Lab Config for this site and have the preferences set in the config.master.php similar to the following:

    1 => array(
        'name'        => 'Files - Documents',
        'server_path' => $media_path . '/files/documents/',
        'url'         => $media_url  . '/files/documents/'
    )

There looks to be two possible problems, the first being that changing something in the config, doesn't reflect the change in Assets, and the problem of the subject matter whereby we see two of each File Upload preference. The above example would have entries in the side column for:

Files - Documents
documents

The proper name, and the name of the directory.

Any assistance would be greatly appreciated.

UPDATE:

Thought I would update showing what's going on in my instance. First of all here's my upload preferences so you can see they're pretty normal beasts.

Screenshot showing File Upload Preferences are normal

Example of what the Images: General paths look like when viewed - ie. not relative

Now this is the output from Assets (v2.0.5) at time of capture.

Assets upload listing - showing double up of upload folders

Note that I have an 'All Media' upload preference so that it can be set within WYGWAM as it only allows for a single upload location. The dated folders at the top of the Asset upload point listing are actually subfolders of the Files: Board Documents pref.

12
  • Glad its not just me. Have P&T looking into it. expressionengine.stackexchange.com/questions/5515/… – stuartmcd69 Feb 4 '13 at 8:41
  • For me this is in the backend when using th Assets file manager. – Brendan Underwood Feb 4 '13 at 13:20
  • Brendan, can you try updating to 2.0.5 and see if that helps? If not, it may be time for me to have a look directly. Thank you! – Lisa Feb 5 '13 at 17:27
  • Brendan, can you try adding the assets_cp_path to your config.php? That is needed if you're using relative paths. Thank you! – Lisa Feb 5 '13 at 18:11
  • I will give that a go, but be aware that the file upload prefs in the Focus Lab config actually resolve to full working paths, not relative. The look relative in the config, but $media_path is a variable that does have the full path. I think we may have solved it on our end though by flushing all the rows in the 'exp_assets_folders' table and doing another Update Index. Problem now we see is after the index it's saying what it looks like all references should be deleted from the DB. Read somewhere this could just be the OCD nature of Assets 2 (BK's words). – Brendan Underwood Feb 5 '13 at 23:35
0

So it looks like we ran into this problem as the first version of Assets that was released didn't honour the settings in our config.master.php for the upload preferences array. This was fixed in Assets v2.0.2 but we had already run the update on the production database (yeah, Rookie mistake) so this is what I did to rectify.

  1. I exported the 'exp_assets' and 'exp_assets_entries' table from a pre Assets v2.x backup.
  2. For good measure I went into each of the 'Content > Files > File Upload Preferences' and hit the update button to make sure the paths etc are saved into the database as well as still in the config and they match.
  3. I dropped all the Assets v2 tables from the active database that has the messed up tables including 'exp_assets_files', 'exp_assets_folders', 'exp_assets_index_data', 'exp_assets_selections' and 'exp_assets_sources'.
  4. Imported the old Assets v1x from the old backup that I exported in step 1 - 'exp_assets' and 'exp_assets_entries' into the active database.
  5. Changed the version number for Assets back to v1.1.5 in 'exp_extentions', 'exp_fieldtypes' and 'exp_modules' within the active database. This triggers Assets to run the update process on the database tables and do all its work.
  6. From the EE CP, go to 'Add-ons > Modules' and click on the 'Assets' module - you should be presented with a warning about backing up the database prior to running the v2.x update. Make sure you update the database prior, then click on the 'Update' button. It will go and do its thing and you should be presented back to Assets with all the correct upload points presented in the left column.

Confirm the Upload Preference selection has been retained by checking an Assets custom field's settings, ie. it should be checked as it was previous to the update. Also double check the front end and be sure images are rendering, and finally edit an entry and just update it to make sure the Assets fields are sticking with the original images and not disappearing.

You can also now run your 'Update Index' inside Assets and there shouldn't be any references (or at least very little) that will appear that are suggested to be deleted (in this case I ran an update index on one and it was clean.

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.