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).

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
Signed-off-by: ailkiv <a.ilkiv.ye@gmail.com>
@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.

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 php PHP related ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants