Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15859 closed bug (fixed)

"OK" button in userguide tool's blockediting window doesn't work

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone:
Component: Website/Userguide Translator Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev54019.

When you do a "block-edit" of a paragraph at the user guide tool, you cannot submit the changes by clicking the "OK" button. This is in the script console:

Attachments (1)

OK-button.png (15.9 KB ) - added by humdinger 5 years ago.

Download all attachments as: .zip

Change History (10)

by humdinger, 5 years ago

Attachment: OK-button.png added

comment:1 by pulkomandy, 5 years ago

Could it be that the userguide translator uses links with the full URL, when they should use something relative at least in XMLHttpRequest?

If I understand things correctly that URL is set in https://github.com/haiku/userguide-translator/blob/da9b3e150455829ee215dc05a70b6ee62b8f3fbb/userguide/inc/config-example.php and then used everywhere.

In particular in the block edit tool: https://github.com/haiku/userguide-translator/blob/da9b3e150455829ee215dc05a70b6ee62b8f3fbb/userguide/shared/block_edit_tool.js

Where I think we should use just /userguide/block_edit.php or even just "block_edit.php" since we're already in the right place.

But it's strange that we get this error, even with an absolute URL, the browser should notice that it matches the current location, still.

comment:2 by waddlesplash, 5 years ago

I've modified the Userguide Translator to use relative URLs. But this should stay open until we've validated that we are doing CORS validation correctly; at least Firefox worked on the old version before.

comment:3 by waddlesplash, 5 years ago

Ah, I see that the Userguide Translator is actually using Synchronous XHRs. That may be the problem here; I think WebKit required special support for those and Otter/WebPositive may not bother to implement it as they are deprecated. I'll work on refactoring the Translator to not require them and see if that fixes it.

comment:4 by waddlesplash, 5 years ago

The problem was indeed caused by Sync XHRs. I've refactored the page to use Async XHRs and now it works in Web+ (however, first click of OK triggers #15625.)

comment:5 by humdinger, 5 years ago

A step forward then, thank you. I still see the same error in the script console though. Changes still are not sent.
Otter still doesn't work with the site: text fields for original and translation in the pop-up window (which opens as a new tab) are still empty.

comment:6 by waddlesplash, 5 years ago

That's strange, I tested it in Web+ and it worked on my end...

comment:7 by waddlesplash, 5 years ago

I've now fixed the Translate Tool to do the same.

comment:8 by humdinger, 5 years ago

Resolution: fixed
Status: newclosed

Confirmed to work. Thanks!

comment:9 by nielx, 5 years ago

Component: Applications/WebPositiveWebsite/Userguide Translator
Milestone: Unscheduled

Update component and remove milestone

Note: See TracTickets for help on using tickets.