2

I upgraded from assets 1 to assets 2. now my folders which start with an underscore are no more recognized. they exist, the images in those folders are shown in the frontend, but i can no more use them in my filemanager. that's a big problem.

The problem was addressed here, but no solution mentioned. There one of the p&t-stuff writes:

Firstly, Assets disallows files and folders that begin with a dot or an underscore, as the convention is to user either of those prefixes for hidden files and folders.

Assets 1 did not forbid me to start folder names with underscores, so modestly I expect an assets-immanent solution.

Is there any solution to this problem?

EDIT: just recognized that i am able to create a new folder with underscore in the beginning; this folder is shown.

2

In Assets 2.2.2 you can't create folders that begin with an underscore. Until we release 2.2.3 it is possible to rename a folder to a name that begins with an underscore, but this is a bad idea, as you'll be unable to index these files.

As for the reason why:
1) Since Assets now supports multiple source types, to eliminate the need for querying S3 and other types of servers every time you access a folder, we had to implement an index of all files and all folders.
2) Assets is compatible with EE Image Manipulations (for EE sources)
3) Image manipulations are stored in folders that begin with underscores.

I'm pretty sure you can see where this is going, but I'll explain, anyway.

  • Allowing the underscores would mean indexing every file in the image manipulation folder and creating a manipulation for those files. And indexing the created files and so on.
  • Allowing folder names that are not used by image manipulations sounds great on paper, until somebody creates an image manipulation that matches the folder name and effectively makes the folder disappear from the File Manager. Not to mention that the user might upload some new files, create a bunch of image manipulations in the folder, delete the manipulation and then complain about how "duplicate have appeared". This all is a support minefield.

So, considering all this and the fact, that having a folder begin with an underscore is rarely a requirement and more often a "I like it that way" kind of thing, we decided to disallow folder names beginning with an underscore.

If you think you have a strong case for having a folder name starting with an underscore, you can update to Assets 2.2.2 and edit the $_skip_folder_patterns array in the third_party/assets/helper.php file, but the support we can provide in cases of modified installations is pretty limited.

| improve this answer | |
  • Nice write up :) – stuartmcd69 Nov 4 '13 at 10:05
  • Andris, thanks for the explanation. But my problem is different: I don't want to create folders with underscores - I really don't care. But once I did and with the new version I cannot manage them anymore. – BNetz Nov 4 '13 at 19:40
  • Well, you can modify the $_skip_folder_patter array, I wrote above. Another way would be to get a hold of a db backup before upgrading to Assets 2, changing the folder names and then change the file_path column in assets table to reflect the new path. – Andris Sevcenko Nov 6 '13 at 7:41
  • thanks, andris, for this solution, but this is certainly not practicable (not only support but also updating should be problematic after this). in my eyes this is not a solution, but I would expect some easy "official" solution from p&t - when I created the folders the underscore was allowed; now if p&t changes this and my folders disappear I expect p&t to generate a solution. – BNetz Nov 9 '13 at 15:12
  • Sorry about the inconvenience, BNetz. As Andris said, the change in Assets was so that Assets could be compatible with a change in EE (image manipulations); it was out of our hands. Unfortunately there’s nothing Assets can do to ease the pain because that would end up likely breaking tons of file URLs across your site. You can either go back to Assets < 1.2, or rename your folders. We can help you with the latter: pixelandtonic.com/consulting – Brandon Kelly Nov 11 '13 at 10:26

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.