Skip to content

Conversation

andersonjeccel
Copy link
Contributor

Q A
Bug fix? (use the a.b branch) ✔️
New feature/enhancement? (use the a.x branch)
Deprecations?
BC breaks? (use the c.x branch)
Automated tests included?
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #...

Description

This PR fixes:

Setting your default file types in configuration was taking no effect.
Now your configured types are used as source for the upload validation.


📋 Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Open https://www.pexels.com/search/videos/sample/
  3. Download any video
  4. Add .mp4 as allowed extension in Config > Asset Settings
  5. Go to Assets > New > Choose your video .mp4 file
  6. See it works

@andersonjeccel andersonjeccel changed the base branch from 7.x to 5.2 June 18, 2025 15:29
@andersonjeccel andersonjeccel requested a review from MadlenF June 18, 2025 15:29
@andersonjeccel andersonjeccel self-assigned this Jun 18, 2025
@andersonjeccel andersonjeccel added T1 Low difficulty to fix (issue) or test (PR) bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging php Pull requests that update Php code assets Anything related to assets labels Jun 18, 2025
Break down the complex if condition in Asset validation into separate
variables to improve code readability and maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.72%. Comparing base (d9a8699) to head (30692bb).
Report is 4 commits behind head on 5.2.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                5.2   #15111   +/-   ##
=========================================
  Coverage     63.72%   63.72%           
- Complexity    34684    34686    +2     
=========================================
  Files          2274     2274           
  Lines        103771   103776    +5     
=========================================
+ Hits          66126    66131    +5     
  Misses        37645    37645           
Files with missing lines Coverage Δ
app/bundles/AssetBundle/Entity/Asset.php 77.20% <100.00%> (+0.22%) ⬆️
...les/AssetBundle/EventListener/UploadSubscriber.php 92.10% <100.00%> (+0.43%) ⬆️
app/bundles/AssetBundle/Form/Type/AssetType.php 98.11% <100.00%> (-0.04%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works.
Code looks good 👍

@kuzmany kuzmany added code-review-passed PRs which have passed code review pending-test-confirmation PR's that require one test before they can be merged and removed code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test labels Jun 19, 2025
Copy link

@MadlenF MadlenF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described! 👍

@kuzmany kuzmany changed the title fix: unable to upload assets with non default file extensions Fix: Unable to upload assets with non-default file extensions Jun 19, 2025
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kuzmany
Copy link
Member

kuzmany commented Jun 19, 2025

I did small update of one if statement to make it more readable

@kuzmany kuzmany removed the pending-test-confirmation PR's that require one test before they can be merged label Jun 19, 2025
@kuzmany kuzmany added this to the 5.2.7 milestone Jun 19, 2025
@kuzmany kuzmany merged commit 3a9010b into mautic:5.2 Jun 19, 2025
17 checks passed
@andersonjeccel andersonjeccel deleted the fix-Unable-to-Upload-Assets-with-Non-Default-File-Extensions branch June 22, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Anything related to assets bug Issues or PR's relating to bugs code-review-passed PRs which have passed code review php Pull requests that update Php code T1 Low difficulty to fix (issue) or test (PR)
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

3 participants