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 languages empty array #20719

Merged
merged 1 commit into from
May 8, 2020
Merged

Conversation

GretaD
Copy link
Contributor

@GretaD GretaD commented Apr 29, 2020

When the language is forced an error occurs:

vue.runtime.esm.js:1888 TypeError: Cannot read property 'concat' of undefined
    at a.userLanguage (UserRowMixin.js:125)
    at hn.get (vue.runtime.esm.js:4479)
    at hn.evaluate (vue.runtime.esm.js:4584)
    at a.userLanguage (vue.runtime.esm.js:4836)
    at a.<anonymous> (UserRowSimple.vue?fb94:1)

this happens because the forcedLanguage returns empty array.
Should be backported to 18 too

@GretaD GretaD force-pushed the fix/fix_languages_empty_array branch from 38a752a to 679c26e Compare April 29, 2020 16:02
@GretaD GretaD requested a review from blizzz April 29, 2020 16:02
@blizzz blizzz requested a review from skjnldsv April 29, 2020 23:12
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

  • Doesn't work for me, using 'force_language' => 'fr', show en
    Capture d’écran_2020-04-30_10-14-58

@GretaD
Copy link
Contributor Author

GretaD commented Apr 30, 2020

Doesn't work for me, using 'force_language' => 'fr', show en

hmm, do we need to change also here?

* @param IUser $user
* @return array
*/
private function getLanguages(IUser $user) {
$forceLanguage = $this->config->getSystemValue('force_language', false);
if($forceLanguage !== false) {
return [];

@rullzer rullzer mentioned this pull request Apr 30, 2020
2 tasks
@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 4, 2020
@skjnldsv skjnldsv force-pushed the fix/fix_languages_empty_array branch from 679c26e to 6727d07 Compare May 4, 2020 13:43
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 4, 2020
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Didn't test but code looks good

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 4, 2020
@skjnldsv
Copy link
Member

skjnldsv commented May 4, 2020

/backport to stable18

@GretaD GretaD force-pushed the fix/fix_languages_empty_array branch 2 times, most recently from 9b68aa0 to 6213478 Compare May 4, 2020 17:19
@rullzer rullzer mentioned this pull request May 4, 2020
3 tasks
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

CI failures:

There were 3 failures:
373	
374	1) OCA\Provisioning_API\Tests\Controller\UsersControllerTest::testGetUserDataAsAdmin
375	Failed asserting that two arrays are equal.
376	--- Expected
377	+++ Actual
378	@@ @@
379	     'website' => 'website'
380	     'twitter' => 'twitter'
381	     'groups' => Array (...)
382	-    'language' => 'de'
383	+    'language' => null
384	     'locale' => null
385	     'backendCapabilities' => Array (...)
386	 )
387	
388	/drone/src/apps/provisioning_api/tests/Controller/UsersControllerTest.php:1019
389	
390	2) OCA\Provisioning_API\Tests\Controller\UsersControllerTest::testGetUserDataAsSubAdminAndUserIsAccessible
391	Failed asserting that two arrays are equal.
392	--- Expected
393	+++ Actual
394	@@ @@
395	     'website' => 'website'
396	     'twitter' => 'twitter'
397	     'groups' => Array ()
398	-    'language' => 'da'
399	+    'language' => null
400	     'locale' => null
401	     'backendCapabilities' => Array (...)
402	 )
403	
404	/drone/src/apps/provisioning_api/tests/Controller/UsersControllerTest.php:1149
405	
406	3) OCA\Provisioning_API\Tests\Controller\UsersControllerTest::testGetUserDataAsSubAdminSelfLookup
407	Failed asserting that two arrays are equal.
408	--- Expected
409	+++ Actual
410	@@ @@
411	     'website' => 'website'
412	     'twitter' => 'twitter'
413	     'groups' => Array ()
414	-    'language' => 'ru'
415	+    'language' => null
416	     'locale' => null
417	     'backendCapabilities' => Array (...)
418	 )
419	
420	/drone/src/apps/provisioning_api/tests/Controller/UsersControllerTest.php:1319
421	
422	--

@MorrisJobke MorrisJobke added 1. to develop Accepted and waiting to be taken care of and removed 4. to release Ready to be released and/or waiting for tests to finish labels May 6, 2020
@rullzer rullzer modified the milestones: Nextcloud 19, Nextcloud 20 May 6, 2020
@rullzer
Copy link
Member

rullzer commented May 6, 2020

/backport to stable19

@GretaD GretaD force-pushed the fix/fix_languages_empty_array branch from 6213478 to cf401e8 Compare May 7, 2020 15:47
@GretaD GretaD requested a review from MorrisJobke May 7, 2020 15:48
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

Signed-off-by: GretaD <gretadoci@gmail.com>
@MorrisJobke MorrisJobke force-pushed the fix/fix_languages_empty_array branch from cf401e8 to fce716b Compare May 8, 2020 08:04
@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 1. to develop Accepted and waiting to be taken care of labels May 8, 2020
@MorrisJobke MorrisJobke merged commit 1d588f6 into master May 8, 2020
@MorrisJobke MorrisJobke deleted the fix/fix_languages_empty_array branch May 8, 2020 09:22
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.

7 participants