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

Create default label when importing assets if none exists #16683

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

marcusmoore
Copy link
Collaborator

Currently, if a user attempts to import assets and there isn't a status label they are presented with an unhelpful error message:
image

Your file import is complete, but we did receive an error. This is usually caused by third-party API throttling from a notification webhook (such as Slack) and would not have interfered with the import itself, but you should confirm this.

This PR allows the import to go through by creating a new "Default" status label with the "Pending" status:
image
A note is added to the status label that indicates how it was created, "Default status label created by AssetImporter".

Copy link

what-the-diff bot commented Apr 10, 2025

PR Summary

  • Updated Handling of Status Labels in Asset Importer
    The changes to 'AssetImporter.php' make it more reliable when interacting with Status Labels. The updates prevent potential errors when trying to access information about these labels. It also ensures a status label will always be available, creating a default one if needed.

  • Introduced Tests for Asset Import
    To verify that the new changes have improved our Asset Importer, we've added a test suite - 'AssetImportTest.php'. These tests check that our default Status Label is correctly selected and that it reverts to the existing one if no deployable label is around. Plus, it ensures a default label is created when none are available. It helps increase confidence in the changes made.

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

Successfully merging this pull request may close these issues.

1 participant