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

After inserting attachment in description, auto-save doesn't work anymore... #532

Closed
Aesculapius opened this issue Jul 13, 2018 · 7 comments

Comments

@Aesculapius
Copy link

Aesculapius commented Jul 13, 2018

Describe the bug
Awesome to see the attachment feature, but after inserting an attachment into the description field, it isn't being auto-saved....

To Reproduce
Steps to reproduce the behavior:

  1. create a card
  2. enter some description
  3. Go to Attachments tab and upload an attachment
  4. Go back to description tab and insert attachment, choose the uploaded one with the arrow
  5. Enter some text after the inserted link...

Expected behavior
I'd expect auto-save to work and the image to be shown

Screenshots
Attached is the status without saving:
image

Client details:

  • OS: Win10
  • Browser Chrome
  • Version 67
  • Device: Desktop

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@juliusknorr
Copy link
Member

@Aesculapius I cannot reproduce this. Can you check the browser console for errors?

@Aesculapius
Copy link
Author

Well, good catch; that definately seems to be the point where things fail :-)

image

@Aesculapius
Copy link
Author

obviously that PUT command is failing with a 500-error. What permissions are needed to make this work? I already created the /cards folder with write permission in the /apps/deck/ folder (wasn't there) but to no avail...

@Aesculapius
Copy link
Author

More info: after looking in the owncloud logging:

{"reqId":"Ztnjwfpfknmw401CwblX", "level":3, "time":"2018-07-17T09:42:17+00:00", "remoteAddr":"ip", "user":"user", "app":"index", "method":"PUT", "url":"\/index.php\/apps\/deck\/cards\/618", "message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\ "Message\":\"An exception occurred while executing 'UPDATE oc_deck_cardsSETdescription = ?,last_modified= ? WHEREid` = ?' with params [\"Contactpersonen\\n- PietjePuk\\n\\nAantal gebruikers\\n- ?\\n\\n\\ud83d\\udcce testbeeld.jpg\\n\\n\\nStatus\\n- Demonstratie is gegeven; zij bestellen een fatcli\\u00ebnt; \\n\", 1531820537, 618]:\n\n

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\\xF0\\x9F\\x93\\x8E A...' for column 'description' at row 1","Code":0,"Trace":"#0 \/var\/www_ssl\/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_ssl\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(177): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE oc_deck...', Array)\\n#2 \\\/var\\\/www_ssl\\\/lib\\\/public\\\/AppFramework\\\/Db\\\/Mapper.php(247): Doctrine\\\\DBAL\\\\Statement->execute()\\n#3 \\\/var\\\/www_ssl\\\/apps\\\/deck\\\/lib\\\/Db\\\/DeckMapper.php(49): OCP\\\\AppFramework\\\\Db\\\\Mapper->execute('UPDATE *PREFIX...', Array, NULL, NULL)\n#4 \/var\/www_ssl\/lib\/public\/AppFramework\/Db\/Mapper.php(187): OCA\\Deck\\Db\\DeckMapper->execute('UPDATE *PREFIX...', Array)\\n#5 \\\/var\\\/www_ssl\\\/apps\\\/deck\\\/lib\\\/Db\\\/CardMapper.php(83): OCP\\\\AppFramework\\\\Db\\\\Mapper->update(Object(OCA\\\\Deck\\\\Db\\\\Card))\\n#6 \\\/var\\\/www_ssl\\\/apps\\\/deck\\\/lib\\\/Service\\\/CardService.php(106): OCA\\\\Deck\\\\Db\\\\CardMapper->update(Object(OCA\\\\Deck\\\\Db\\\\Card))\\n#7 \\\/var\\\/www_ssl\\\/apps\\\/deck\\\/lib\\\/Controller\\\/CardController.php(95): OCA\\\\Deck\\\\Service\\\\CardService->update(618, 'Reumatische Zie...', 90, 'plain', 0, '**Contactperson...', 'user', NULL)\\n#8 [internal function]: OCA\\\\Deck\\\\Controller\\\\CardController->update(618, 'Reumatische Zie...', 90, 'plain', 0, '**Contactperson...', NULL)\\n#9 \\\/var\\\/www_ssl\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(161): call_user_func_array(Array, Array)\\n#10 \\\/var\\\/www_ssl\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(91): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Deck\\\\Controller\\\\CardController), 'update')\\n#11 \\\/var\\\/www_ssl\\\/lib\\\/private\\\/AppFramework\\\/App.php(115): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Deck\\\\Controller\\\\CardController), 'update')\\n#12 \\\/var\\\/www_ssl\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main('OCA\\\\\\\\Deck\\\\\\\\Contro...', 'update', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#13 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#14 \\\/var\\\/www_ssl\\\/lib\\\/private\\\/Route\\\/Router.php(297): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#15 \\\/var\\\/www_ssl\\\/lib\\\/base.php(999): OC\\\\Route\\\\Router->match('\\\/apps\\\/deck\\\/card...')\\n#16 \\\/var\\\/www_ssl\\\/index.php(42): OC::handleRequest()\\n#17 {main}\",\"File\":\"\\\/var\\\/www_ssl\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":115}","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.99 Safari\/537.36","version":"13.0.4.0"}

Which tells me:

General error: 1366 Incorrect string value: '\\xF0\\x9F\\x93\\x8E A...' for column 'description' at row 1","Code":0,\

Some problem with escaping or database format?
I'm using MySql database

@juliusknorr
Copy link
Member

Thanks for the log files. This is actually a bug. Your database doesn't have 4-byte support enabled and therefore fails to insert the attachment icon. We should not add that icon in that case.

Reference regarding 4-byte support:
https://docs.nextcloud.com/server/13/admin_manual/configuration_database/mysql_4byte_support.html

@juliusknorr juliusknorr added this to the 0.4.1 milestone Jul 17, 2018
@Aesculapius
Copy link
Author

Aesculapius commented Jul 17, 2018

Or should I just enable this 4-byte support then?
I did just that and it works. Thanks for the link :-)

@juliusknorr
Copy link
Member

Yes, that should fix it as well 😉

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

No branches or pull requests

2 participants