brantje / nextnote

A full Evernote / OneNote style WYSIWYG note editor for Nextcloud / ownCloud. Join our telegram at: https://t.me/NextNote
GNU Affero General Public License v3.0
163 stars 19 forks source link

Sharing #50

Closed brantje closed 6 years ago

brantje commented 6 years ago

Sharing is ready for testing! I've fixed some API's that we're removed, unannounced by Nextcloud.

To test sharing

Clone master

Checklist

mikshepard commented 6 years ago

Tried this but it's having issues. I create a note, click the share button, start typing a name, click the autocompleted one, and nothing happens. Further attempts to share add more than one sharing field. I finally refreshed the page and the note is gone. Looking in the database, the note is still there but not displayed.

Here is a screenshot of what I see

image

Here is the log output, looks like a mysql issue of no default value for "groups" and something else:

{"reqId":"D6FbdS2YdgD0UBtK3FEH","level":3,"time":"2018-04-04T10:39:31-05:00","remoteAddr":"X.X.X.X","user":"admin","app":"index","method":"POST","url":"\/apps\/nextnote\/api\/v2.0\/note","message":"Exception: {\"Exception\":\"Doctrine\\DBAL\\Exception\\DriverException\",\"Message\":\"An exception occurred while executing 'INSERT INTO oc_nextnote(name,uid,note,mtime,shared) VALUES(?,?,?,?,?)' with params [\\"New note\\", \\"admin\\", \\"

Sdfs<\\\\/p>\\", 1522856371, false]:\n\nSQLSTATE[HY000]: General error: 1364 Field 'grouping' doesn't have a default value\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Statement.php(177): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'INSERT INTO oc...', Array)\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/public\\\/AppFramework\\\/Db\\\/Mapper.php(247): Doctrine\\\\DBAL\\\\Statement->execute()\\n#3 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/public\\\/AppFramework\\\/Db\\\/Mapper.php(125): OCP\\\\AppFramework\\\\Db\\\\Mapper->execute('INSERT INTO*P...', Array)\n#4 \\/var\\/www\\/nextcloud\\/apps\\/nextnote\\/lib\\/Db\\/NextNoteMapper.php(131): OCP\\AppFramework\\Db\\Mapper->insert(Object(OCA\\NextNote\\Db\\NextNote))\n#5 \\/var\\/www\\/nextcloud\\/apps\\/nextnote\\/lib\\/Service\\/NextNoteService.php(97): OCA\\NextNote\\Db\\NextNoteMapper->create(Object(OCA\\NextNote\\Db\\NextNote))\n#6 \\/var\\/www\\/nextcloud\\/apps\\/nextnote\\/controller\\/nextnoteapicontroller.php(113): OCA\\NextNote\\Service\\NextNoteService->create(Object(OCA\\NextNote\\Db\\NextNote), 'admin')\n#7 [internal function]: OCA\\NextNote\\Controller\\NextNoteApiController->create('New note', NULL, '

Sdfs<\\/p>')\n#8 \\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(161): call_user_func_array(Array, Array)\n#9 \\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(91): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\NextNote\\Controller\\NextNoteApiController), 'create')\n#10 \\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/App.php(115): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\NextNote\\Controller\\NextNoteApiController), 'create')\n#11 \\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/Routing\\/RouteActionHandler.php(47): OC\\AppFramework\\App::main('OCA\\\\NextNote\\\\Co...', 'create', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#12 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#13 \\/var\\/www\\/nextcloud\\/lib\\/private\\/Route\\/Router.php(297): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#14 \\/var\\/www\\/nextcloud\\/lib\\/base.php(998): OC\\Route\\Router->match('\\/apps\\/nextnote\\/...')\n#15 \\/var\\/www\\/nextcloud\\/index.php(37): OC::handleRequest()\n#16 {main}\",\"File\":\"\\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractMySQLDriver.php\",\"Line\":115}","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.183 Safari\/537.36 Vivaldi\/1.96.1137.3","version":"13.0.1.1"}

{"reqId":"6ykhh0ZnG1SBGYmRjZy2","level":0,"time":"2018-04-04T10:39:39-05:00","remoteAddr":"X.X.X.X","user":"admin","app":"core","method":"PUT","url":"\/apps\/nextnote\/api\/v2.0\/note\/2","message":"Scss is disabled for \/var\/www\/nextcloud\/core\/css\/styles.scss, ignoring","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.183 Safari\/537.36 Vivaldi\/1.96.1137.3","version":"13.0.1.1"}

I'm using Nextcloud v13.0.1 with LDAP users. Debian Jessie with php 7.2, mysql 5.7.21, kernel 4.14.28

I'm happy to wipe the database and run more tests, lemme know how I can help.

brantje commented 6 years ago

Can you fill a grouping field and try again? I'll push a fix for default value.

mikshepard commented 6 years ago

I create a new note and assign it to a "new group" called "ITS". After saving the note, the group doesn't show in the sidebar, nor is the note assigned to this "ITS" group. Looking in the database, the "grouping" field for this note is populated with "_new". Here is the log output:

{"reqId":"XaXgwcOTnVM50bdCABj2","level":3,"time":"2018-04-04T14:12:44-05:00","remoteAddr":"X.X.X.X","user":"admin","app":"index","method":"POST","url":"\/index.php\/apps\/w2g2\/ajax\/updateDatabase.php","message":"Exception: {\"Exception\":\"Doctrine\\DBAL\\Exception\\SyntaxErrorException\",\"Message\":\"An exception occurred while executing 'ALTER TABLE oc_locks_w2g2 RENAME COLUMN name TO file_id':\n\nSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLUMN name TO fileid' at line 1\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Statement.php(177): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'ALTER TABLE oc...', Array)\n#2 \\/var\\/www\\/nextcloud\\/lib\\/private\\/legacy\\/db\\/statementwrapper.php(73): Doctrine\\DBAL\\Statement->execute()\n#3 \\/var\\/www\\/nextcloud\\/apps\\/w2g2\\/lib\\/Migration\\/UpdateDatabase.php(87): OC_DB_StatementWrapper->execute()\n#4 \\/var\\/www\\/nextcloud\\/apps\\/w2g2\\/lib\\/Migration\\/UpdateDatabase.php(20): OCA\\w2g2\\Migration\\UpdateDatabase->update()\n#5 \\/var\\/www\\/nextcloud\\/apps\\/w2g2\\/ajax\\/updateDatabase.php(14): OCA\\w2g2\\Migration\\UpdateDatabase->run()\n#6 \\/var\\/www\\/nextcloud\\/lib\\/private\\/Route\\/Route.php(155): require_once('\\/var\\/www\\/nextcl...')\n#7 [internal function]: OC\\Route\\Route->OC\\Route\\{closure}( sensitive parameters replaced )\n#8 \\/var\\/www\\/nextcloud\\/lib\\/private\\/Route\\/Router.php(297): call_user_func(Object(Closure), Array)\n#9 \\/var\\/www\\/nextcloud\\/lib\\/base.php(998): OC\\Route\\Router->match('\\/apps\\/w2g2\\/ajax...')\n#10 \\/var\\/www\\/nextcloud\\/index.php(37): OC::handleRequest()\n#11 {main}\",\"File\":\"\\/var\\/www\\/nextcloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractMySQLDriver.php\",\"Line\":90}","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.183 Safari\/537.36 Vivaldi\/1.96.1137.3","version":"13.0.1.1"}

mikshepard commented 6 years ago

Groups seems to be working great now in the lastest git pull today. However, sharing is not. When I click the share button, start to type a name, I can see that autocomplete show up with the user, but I cannot select the user for sharing. Here is what I found in the logs:

{"reqId":"Qwcyq9PcCo9mmwJcazzb","level":0,"time":"2018-04-07T11:01:49-05:00","remoteAddr":"X.X.X.X","user":"admin","app":"core","method":"POST","url":"\/apps\/nextnote\/api\/v2.0\/sharing\/shares","message":"Scss is disabled for \/var\/www\/nextcloud\/core\/css\/styles.scss, ignoring","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.183 Safari\/537.36 Vivaldi\/1.96.1137.3","version":"13.0.1.1"}

brantje commented 6 years ago

Can you please post details about your setup? The scss error isn't related to NextNote.

mikshepard commented 6 years ago

Sure, I'm using Nextcloud v13.0.1 with LDAP users. Debian Jessie with php 7.2, mysql 5.7.21, vanilla kernel 4.14.28

brantje commented 6 years ago

Can you try sharing with a local user? I don't have a local LDAP setup yet. So didn't test sharing with LDAP users...

mikshepard commented 6 years ago

@brantje, yes, local users work fine. Further investigations show that some LDAP users can be added, others not. Seems to be an issue on my end with LDAP.

UPDATE: Confirmed. I tested Nextnote on a second server with a git pull from today, sharing is working with LDAP.

ANOTHER BUG: Clicking the "trash" icon to remove a user from the shared list doesn't work. I am not able to click on the "trash" icon, seems to not be recognized as a link?

brantje commented 6 years ago

Closing, sharing will be rebuild this weekend, after that i'll open a new issue.