0

For two channels that restricts uploads to subdirectory/{owner.slug}, when I want to add an image in an existing entry, the Add an Asset modal window doesn't list the existing images (this is a matrix field that supports multiple images). All other cases where the restricted directory isn't a dynamic asset folder work fine. I've updated Asset Indexes and Cleared Caches, but still no luck. Any idea what's up? Thanks.

| improve this question | | | | |
  • I thinks it's a bug and you should contact P&T directly with that. It'd be great if you could update here and tell us how things turned out ... – carlcs May 5 '15 at 17:25
1

It's because of how Craft resolves dynamic paths (paths with {variables}) in them. For freshly created Matrix blocks haven't been saved yet and therefore don't have an {owner} yet.

If a dynamic path cannot be resolved, then Craft will point it to a temporary folder that is unique per user per field, but, as soon as you save the Entry and the Matrix block has an {owner}, it will resolve to where it should and all the Assets from the temporary folder that were selected will be move to the resolved folder.

Any Assets that have not been selected will remain in the temporary folder. This also holds true for unsaved Entries if you're using {slug}, for example.

| improve this answer | | | | |
  • Hi Andris, Seems odd to have the inconsistency in the modal window for the client, given that the entry is already saved, so the owner has been established. At any rate, thanks for the feedback. – Paula May 14 '15 at 13:39
  • Well, while it seems inconsistent in modals, it's exactly consistent on a technical level :) We'll be addressing this in Craft 3.0, but it'll be a while until it's out.. – Andris Sevcenko May 14 '15 at 17:39
  • Hmmm. Thw channel is to store businesses in a directory, and there is an Image matrix to allow the client to load a varied number of photos for each business. If the client adds the photos via the Assets tab (from the top nav bar) to that business's subdirectory, right now there is no way they can then view these photos from the business's entry as options to actually associate with that business via the modal. None of the current files are listed, even though they are already saved and associated with an existing entry. Sorry if I'm missing something, but that's pretty basic functionality. – Paula May 19 '15 at 0:32

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.