Closed randylang closed 4 years ago
Note to self: Dockerfile.zip
Hello. We have the same problem here. In some occasions, modifications disappear when we switch from Visual to Textile tab. When this happens, we get this error message in our browser console:
TypeError: m is null >>> redmine_wysiwyg_editor.js:887:18
So it seems to come from this code:
var m = node.getAttribute('href')
.match(/\/projects\/([\w-]+)\/wiki(?:\/([^,./?;:|]+)(#.+)?)?$/);
var proj = m[1];
var page = m[2] ? decodeURIComponent(m[2]) : null;
Hi @nanego
Thank you for your information. I guess wiki link causes the issue.
Could you please tell me your wiki link code which causes an error?
I assume that the dockerfile is for me? The content of the script looks Linux centric, not sure it will work on my windows installation.
After reading the comment from @nanego, I realized I should look at the browser console.
I installed 0.15.1, then looked to see if the issue was fixed. It is not, the attached file contains the error information from the browser console.
I assume that the dockerfile is for me?
No, it is just for me.
I installed 0.15.1, then looked to see if the issue was fixed. It is not,
0.15.1 has resolved not this issue but #84.
Thank you for your console log. However, I don't know the root cause...
If there is anything I can do to help let me know. I’m not sure I can do much, I have very little knowledge about Ruby or Java.
Hi @randylang
Could you please replace redmine_wysiwyg_editor.js with attached one and tell me the href values on console.log?
Hi @taqueci I just tried with the modified js file. Here is what I get:
// redmine_wysiwyg_editor.js:884:15
href = #1
href = /projects/my-project/wiki/Session_timeout_
TypeError: m is null
Hi @nanego
Thank you for your information.
I can reproduce the issue by:
h1. Wiki
[[Wiki#Wiki]]
I will try it as soon as I have a chance. Thank you.
On Tue, Apr 28, 2020 at 8:57 AM taqueci notifications@github.com wrote:
Hi @nanego https://github.com/nanego and @randylang https://github.com/randylang
Could you please try branch issue/83 https://github.com/taqueci/redmine_wysiwyg_editor/tree/issue/83?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/taqueci/redmine_wysiwyg_editor/issues/83#issuecomment-620589596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH3IIEPBZ3QRFE3BI5ABPDRO3HEZANCNFSM4LTYBUZA .
-- Randy Lang Electrical Engineer
randy.lang@ieee.org http://www.linkedin.com/in/randylang
I don't think it worked.
I snagged the complaints from the Chrome console.
wysiwyg issue 83 chrome log tinymce verbose-1588092846055.log wysiwyg issue 83 chrome log verbose-1588092846055.log wysiwyg issue 83 chrome log-1588092846055.log wysiwyg issue 83 chrome log info-1588092846055.log
Thank you for this patch @taqueci. I tested it. Unfortunately, it does not fix the issue in my case. I still get the same errors in my browser. I will try again to isolate a minimal text in order to show you how to reproduce the error.
Actually, I just retried in wikis, and the error seems to be gone. But I still see it when I edit issues description.
I spent some time with the console, I caused the issue by adding some text to a page, then switching from visual editor to preview. I set a break at line 895.
When the errors occur, href at line 897 is:
href = "/redmine/projects/aerosonic-polices-and-procedures/wiki/Software_Processes?parent=Subversion"
and the match on line 892 must be failing.
When it works,
href = "/redmine/projects/aerosonic-polices-and-procedures/wiki/Finding_Old_Commit_Messages"
and m is an array of stuff.
I don't know if its relevant but when it fails,
node = a.wiki-page.new {target: "", download: "", ping: "", rel: "", relList: DOMTokenList(0), …}
When it works, node = a.wiki-page { . . . }
My hunch is that the regular expression needs to be reworked to function when href includes the query.
The structure that was added to the page in question is like the following (shown in textile for clarity) Software Processes is an existing page. The New Text was the added content. . . .
h2. Some header . . .
Hi @randylang
Thank you for your information.
As you have guessed, the error is caused by query parameter.
Could you please try branch issue/83a?
I believe you have fixed it.
Thank you for the help and the excellent plugin.
The commit has been merged to the mater branch. Thank you for your cooperation.
I'm pleased that it works. I’ve been using it all day. I wish I had realized there was a debugger built into chrome sooner, I wouldn’t have wasted your time with all those log files.
Hi @nanego
I just tried with the modified js file. Here is what I get:
// redmine_wysiwyg_editor.js:884:15 href = #1 href = /projects/my-project/wiki/Session_timeout_ TypeError: m is null
I don't know the latest version solves your problem or not. If you still have error, please create new issue.
Hi @taqueci I still get an error with the last version. I have just created a new issue (#86) and I added details to easily reproduce the error. Thank you for your help.
There are some instances when edits made in the Visual Editor disappear after saving or switching to one of the other views.
It does not happen when editing a new page.
I have tested several situations on one page to verify statement made in this issue: