Skip to content
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

[4.x] When updating asset references, check the type of the data instead of max_files #9790

Closed

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 26, 2024

This pull request attempts to prevent an issue where renaming / moving assets would cause the references to that asset in content to not be updated.

From my testing, a foreach() argument must be of type array|object, string given error would occur when a blueprint had an Assets field but the paths to the assets in the content was formatted differently.

For example:

  • If you have max_files: 1 set on your Assets field, then later remove it, when you rename/move an asset, you'd experience the error because the AssetReferenceUpdater expects data to be stored as an array, however some data is still stored as strings.
  • The reverse of this is also true. If you don't have max_files set at all, then set max_files: 1, when you rename/move assets, you'd experience the error since AssetReferenceUpdater expects the data to be an array but it's a string.

Closes #9701.
Related to #7555 and #8114.

@jesseleite
Copy link
Member

Closing in favour of #9878. Thanks for taking the time to PR this! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorganizing assets in CP don't update any paths (at all)
2 participants