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

Bug. Question type File. When multiple types are selected, only one is used. #2241

Merged

Conversation

AIlkiv
Copy link
Collaborator

@AIlkiv AIlkiv commented Jul 10, 2024

foreach ($question['extraSettings']['allowedFileTypes'] as $type) {
	$question['accept'] = array_keys(array_filter($aliases, function (string $alias) use ($type) {
		return $alias === $type;
	}));
}

At each iteration, $question['accept'] is overwritten

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.34%. Comparing base (96e6790) to head (e98906d).
Report is 392 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2241      +/-   ##
============================================
+ Coverage     46.03%   46.34%   +0.30%     
+ Complexity      800      799       -1     
============================================
  Files            66       66              
  Lines          3065     3064       -1     
============================================
+ Hits           1411     1420       +9     
+ Misses         1654     1644      -10     

@Chartman123 Chartman123 added bug Something isn't working php PHP related ticket 2. developing Work in progress feature: ❓ question types labels Jul 10, 2024
@Chartman123 Chartman123 added this to the 4.3 milestone Jul 10, 2024
@AIlkiv AIlkiv force-pushed the fix-file-types-for-question-files branch 2 times, most recently from bab5f90 to 3d7dffc Compare July 10, 2024 08:23
Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

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

Some comments after reviewing the code, will test it later :)

tests/Unit/Service/FormsServiceTest.php Show resolved Hide resolved
tests/Unit/Service/FormsServiceTest.php Outdated Show resolved Hide resolved
lib/Service/FormsService.php Outdated Show resolved Hide resolved
@AIlkiv AIlkiv force-pushed the fix-file-types-for-question-files branch from 3d7dffc to bd49e13 Compare July 10, 2024 10:37
@AIlkiv AIlkiv force-pushed the fix-file-types-for-question-files branch from bd49e13 to e98906d Compare July 10, 2024 10:40
@Chartman123 Chartman123 requested a review from Koc July 10, 2024 14:38
@Chartman123 Chartman123 merged commit a33f114 into nextcloud:main Jul 10, 2024
51 checks passed
@Chartman123
Copy link
Collaborator

@AIlkiv would you like to join our Forms team on cloud.nextcloud.com? If yes, I could help you get an account there as well...

@AIlkiv
Copy link
Collaborator Author

AIlkiv commented Aug 10, 2024

@AIlkiv would you like to join our Forms team on cloud.nextcloud.com? If yes, I could help you get an account there as well...

@Chartman123 Yes. Please help me with that.

Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress bug Something isn't working feature: ❓ question types feedback-requested php PHP related ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants