Closed alexisrosano89 closed 6 years ago
Yes, I have seen that as well - only haven't opened a bug for it yet. I was surprised that @brantje didn't run into that himself.
Thanks for confirm that bug.
Do you have a workarround for this? I'm looking at the code right now.
Unfortunately, my angular knowledge is quite limited. I'm looking at NoteEditCtrl.js that seems to do the save ($scope.saveNote) but I would need to try and debug that to understand it. Especially, what would be different for update vs create...
Yeap, im looking at that code too.. And my situation with angular is the same as you :-1:
So maybe we're able to find something by simply poking around :-)
Live debugging... Difference I could find so far in the client:
create: NoteFactory.js calls backend with method: 'POST' update: NoteFactory.js calls backend with method: 'PUT'
Yeap, I've seen that.
The strange thing is that the title and group it's saved correctly with the POST.
I have some debug output on the server directly in nextnoteapicontroller.php. There already no content is received in the create() method. So its either not sent or not properly declared on the server side.
Update: The POST request from the client contains the content. So its a server issue
Look at the console, the content is sent!
Yes, and I think I have found the bug @server side. Need to play around a bit...
Waiting for your comments :call_me_hand:
OK, seems like nextcloud is doing the matching from the POST parameters to the create() function parameters by NAME
And guess what, in nextnoteapicontroller.php the parameter is called $note instead of $content :-)
Since I'm working on another branch: could you please try to change nextnoteapicontroller.php on your end to replace $note with $content in the create() method? I found two places:
1) in parameter list 2) 'note' => $note
If that fixes it on your end I would change the master branch directly.
Now it's working! :call_me_hand:
Pull request merged
Hello, when I create a note, the text inside it is not saved.
But if I modify that note, the text inside is correctly saved.
Could you reproduce that?
Regards!