Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Mar 7, 2025

  • Returning boolean on a controller just output said boolean as plain text in the reponse
  • Encoding JSON before sending the request with axios will result in double encoding and failure to be read by the backend
  • Added error handling from the backend too

Fix #49829
Followup from #50910

Regression from

@skjnldsv skjnldsv self-assigned this Mar 7, 2025
@skjnldsv skjnldsv requested review from a team as code owners March 7, 2025 13:26
@skjnldsv skjnldsv requested review from Altahrim, Pytal, artonge, come-nc and sorbaugh and removed request for a team March 7, 2025 13:26
@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Mar 7, 2025
@skjnldsv skjnldsv force-pushed the fix/storage-settings branch from e3919da to 938d20d Compare March 7, 2025 13:37
@skjnldsv
Copy link
Member Author

skjnldsv commented Mar 7, 2025

/backport to stable31

@skjnldsv
Copy link
Member Author

skjnldsv commented Mar 7, 2025

/backport to stable30

@skjnldsv
Copy link
Member Author

skjnldsv commented Mar 7, 2025

/backport to stable29

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Makes sense

@skjnldsv skjnldsv force-pushed the fix/storage-settings branch from 938d20d to c19fe5f Compare March 7, 2025 15:12
Copy link
Member

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

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

🙏

@skjnldsv skjnldsv force-pushed the fix/storage-settings branch from c19fe5f to 56b2c7b Compare March 8, 2025 08:51
@skjnldsv
Copy link
Member Author

skjnldsv commented Mar 8, 2025

/compile

@skjnldsv skjnldsv enabled auto-merge March 8, 2025 09:43
@nsemov
Copy link

nsemov commented Mar 9, 2025

I'm running 31.0.0 and noticed that when saving global credentials the browser says it submits payload:
{"uid":"","user":"asdasd","password":"asdasdasd"}

But by the time saveGlobalCredentials is called in AjaxController, $uid is NULL rather than an empty string, so the $uid === '' comparison fails and permission to set the credentials is denied.

Unfortunately I'm too basic to see if all these changes that were implemented will correctly pass an empty string to the saveGlobalCredentials rather than a NULL.

[Edit]
Actually, all 3 parameters passed to saveGlobalCredentials are NULL ... :-(

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/storage-settings branch from 3f08110 to b25b11d Compare March 11, 2025 10:39
@skjnldsv
Copy link
Member Author

/compile amend /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@skjnldsv skjnldsv disabled auto-merge March 11, 2025 13:11
@skjnldsv skjnldsv merged commit a00d0d1 into master Mar 11, 2025
191 of 193 checks passed
@skjnldsv skjnldsv deleted the fix/storage-settings branch March 11, 2025 13:11
@backportbot
Copy link

backportbot bot commented Mar 11, 2025

The backport to stable31 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable31
git pull origin stable31

# Create the new backport branch
git checkout -b backport/51320/stable31

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 07264dff 2f4b4ce4

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/51320/stable31

Error: Failed to create pull request: Validation Failed: {"resource":"PullRequest","field":"head","code":"invalid"}


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@skjnldsv
Copy link
Member Author

/backport 07264df to stable31

@skjnldsv
Copy link
Member Author

Error: Failed to create pull request: Validation Failed: {"resource":"PullRequest","field":"head","code":"invalid"}

That's a new one 🤔

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.

[Bug]: Can't save global credentials in external storage

7 participants