-
-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganizing assets in CP don't update any paths (at all) #9701
Comments
@axelferdinand we are also running into very strange behaviour.. have you found a solution? |
Hey @theLeroy Unfortunately, no. In my case, it's a multisite that I've ran for years, upgrading all the way from early v2 to latest version. Possibly that's the issue – I haven't tried this on a fresh install. |
In our case the issue is that we've implemented a custom replicator that we called "components", however, we didn't realize that the replicator handle name was hard-coded and necessary for the update of asset paths to work. See line cms/src/Data/DataReferenceUpdater.php Line 101 in 84d5c23
The solution for us was to update this array with our custom name and an ugly fix to use the same replicator update function. A warning could be helpful (e.g. "unable to find update function for custom field-type "), although I think of this as an edge case. |
@arcs- Is THAT the case?? So, if I name the replicator field something custom, it wont work? |
So to fix this, I need to add my replicator name like this?
|
I think what @arcs- meant is that they implemented a custom replicator, meaning a custom fieldtype. |
@afonic Ah, OK. I think I understand. My replicator is 100% Statamic, as far as I can see, and this should work out of the box? |
@axelferdinand, maybe you can replicate your setup in a fresh Statamic install and report here? Generally this feature works for me. |
@afonic To install my client's theme on a fresh install? I guess I will need to try that. Just wonder if it's my setup that has a problem. |
If you can recreate your replicator setup in a fresh install and it still doesn't work then it's probably a bug and the core team will get to it. If it works fine, then it's probably something wrong with your setup. There have been quite a few changes in the blueprints' yaml files and if the site is really old it sometimes messed up things. I'd also try to open the blueprint in question and save it again in the control panel. |
Thanks for the tip with saving the blueprint again – as you said, a lot restructured on save. But unfortunately, when trying to relocate assets, only the asset meta files updates – and none of the md-files with the paths. |
Maby the fact that i don't works with custom Fieldtypes should be mentioned in the documentation. Or the Recursive function should be updated. |
Apologies for jumping in a bit late to this discussion. I've uploaded some assets into my sandbox site, added them to various entries (both in Bard sets & Asset fields in the "root" of entries). Then, when I renamed them or moved them into different folders, I can see that the paths are being updated as expected. 🤔 @axelferdinand @theLeroy I have a couple of questions for you both...
If either of you are able to reproduce the issue in a fresh Statamic site or share access to the code, that might be helpful in us getting to the bottom of the issue. Thanks. |
In fact... I've just tested this in a larger project and I can reproduce it there. I'm using a queue worker and I wonder if that's the same error either of you were running into... can you see that error at all in your logs? |
I'm experiencing the same issue on different installs with Multi-site enabled. My assets are configured in DO Spaces filesystem and not updating the references on renaming/moving within the CP. I have tested it on multiple ways, looks like it is working fine on 'first level' fields, but once it is inside a Replicator field it doesn't update the references. Queue worker is set to Redis (with database queue it also doesn't update) and outputting the following after changing asset that is linked inside a replicator field:
Maybe this helps a bit in debugging. Already experiencing this issue for 1 or 2 months, or even longer. Thought it was something in my own installs, but then I found this issue :) addition: I'm also using Glide & a Glide Redis cache, I'm not sure if that can also impact this. |
@duncanmcclean Thanks for looking into this!! Were you renaming / moving the assets locally or on a server? Do you have queue workers configured for either of these environments? Where are your assets stored? Logs |
Sounds like the issue I ran into (& PR'd a fix for) is different to the one your facing. Is anyone able to reproduce this on a fresh site OR share their site with us for testing? That would make it much easier for us to find the cause issue. |
Just shared repo access with you, Duncan :) |
Thanks! |
@axelferdinand Thanks for providing the repository! I've managed to figure out why Statamic wasn't updating any references. The It should be set to https://github.com/statamic/cms/blob/4.x/config/system.php#L142-L153 As far as I can tell, the config option has defaulted to Once you enable it and try to rename or move an asset, you might run into the error I noticed the other day ( I'll leave this issue to be closed when that PR is merged. |
@duncanmcclean I have |
Are you able to share your repository or reproduce the same issue on a fresh site? |
Yes, but I can share it probably after the weekend. I will have to make a fresh site with our default setup and see if it is also happening there. |
We haven't tagged a release with the fix yet. The fix will be part of the next release. |
Bug description
I just did a major restructuring within my Assets in CP, solely using the CP moving assets. According to the docs, paths to images are supposed to update, but (almost) all my assets are now unlinked in front-end..
I'm using the Assets fieldtype and Bard. I can share repo access, if wanted.
How to reproduce
(see above)
Logs
Environment
Installation
Existing Laravel app
Antlers Parser
None
Additional details
No response
The text was updated successfully, but these errors were encountered: