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

Fix HTTP AssetTransformer to generate an empty object for missing custom fields #12106

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

fernando-almeida
Copy link
Contributor

Description

If an asset does not have any associated custom fields the application is returning an empty array instead of an empty object defrauding output type expectation for the property.

Fixes # (issue)

#9700

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration:

  • PHP version:
  • MySQL version
  • Webserver version
  • OS version

Checklist:

@welcome
Copy link

welcome bot commented Nov 14, 2022

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@what-the-diff
Copy link

what-the-diff bot commented Nov 14, 2022

  • Change the type of custom_fields from array to object
  • Add a new line comment "HACK" in front of the code that was changed

@snipe snipe merged commit ae259f3 into snipe:develop Nov 15, 2022
@welcome
Copy link

welcome bot commented Nov 15, 2022

Congrats on merging your first pull request! 🎉🎉🎉

@snipe
Copy link
Owner

snipe commented Nov 15, 2022

Hm, I'm actually seeing some issues with this if the asset is deleted. I'll try to fix.

snipe added a commit that referenced this pull request Nov 15, 2022
…_stdClass

Fixes PR #12106 missing slash for std class
@fernando-almeida
Copy link
Contributor Author

fernando-almeida commented Nov 15, 2022 via email

@snipe
Copy link
Owner

snipe commented Nov 15, 2022

No problem :) Was just a missing slash to provide namespace context :)

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

Successfully merging this pull request may close these issues.

2 participants