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

API Issue adding folder on root. #2312

Closed
asgomes opened this issue Jun 20, 2018 · 2 comments
Closed

API Issue adding folder on root. #2312

asgomes opened this issue Jun 20, 2018 · 2 comments
Labels

Comments

@asgomes
Copy link

asgomes commented Jun 20, 2018

Hi we have a 2.1.27.12 version of Teampass.

I am trying to add a folder through the rest api with root folder (id=0) as a parent and it fails with error message
{"err":"No destination folder provided"}.

*Steps to reproduce
Invoke add folder api like:
https://teampass.pt/api/index.php/add/folder/TestFolder;60;0;0;0?apikey=mykeyhereeeEEe

*Expected behaviour
Folder should be created with success message.

*Actual behaviour
Folder creation fails with message:
{"err":"No destination folder provided"}.

Problem:

Arguments validation fails on string ("TestFolder;60;0;0;0") unexpectedly fails when 2nd parameter "parent folder id" is 0,
because PHP method Empty returns false when the parameter is "0".
(similar to #1796 but in parent folder)

on file:
Teampass/api/functions.php
1030. if (--> empty($params[2]) <--) {
1031. rest_error('NO_DESTINATION_FOLDER');
1032. }

@nilsteampassnet
Copy link
Owner

Strange but did the fix.

@asgomes
Copy link
Author

asgomes commented Jul 3, 2018

Hi Nils,

thanks in advance, where should I find this fix?

Is it ok to apply in 2.1.27.12?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants