Opened 9 years ago
Last modified 8 years ago
#13943 review Bug
When custom config is missing, the default config gets loaded twice.
Reported by: | Jakub Ś | Owned by: | kkrzton |
---|---|---|---|
Priority: | Nice to have (we want to work on it) | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | Support. | Cc: |
Description
Steps to reproduce
- Put below code into your config.js (custom config file doesn't exist under given path)
config.specialChars = config.specialChars.concat([['♂', 'Male']]); config.customConfig = '/abc/config.js';
- Open Special Characters dialog
Expected result
One male symbol is visible.
Actual result
Two male symbols are visible.
Other details (browser, OS, CKEditor version, installed plugins)
Happens in all browsers. I have been able to reproduce this issue from CKEditor 4.0
This issue has been reported on our support channel.
Change History (15)
comment:1 Changed 9 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 9 years ago by
Owner: | set to kkrzton |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 9 years ago by
Milestone: | → CKEditor 4.5.7 |
---|
comment:4 Changed 9 years ago by
comment:5 Changed 9 years ago by
Status: | assigned → review |
---|
comment:6 Changed 9 years ago by
Status: | review → review_failed |
---|
- Please add tests to editor.js test suite. And put a ticket number in the comment, e.g. like it's done here.
- Instead of using multiple variables for counters, you could just use 2 counters and reset them in test suite
setUp
method
- There is a problem that you rely on config implementation detail to make tests, e.g. in config1.js. Sometimes it's tough to avoid it - I know.
But in this particular case you couldn't you simply use two variables for the counters/boolean?
Let's say you create
CKEDITOR._testCustom
andCKEDITOR._timesExecuted
. These variables are reset in test suitesetUp
method.
I see what was the reason why you used real config.js files at all, it's because your custom variables would not be modified/incremented otherwise. To solve this you could simply init one editor with:
bender.editor = { config: { customConfig: '%TEST_DIR%_assets/config.js' } }
So this instance would be loaded firist and it will load existing config.js (which will increase CKEDITOR._testCustom in its callback).
- 1.js - I'm not entirely sure what you mean by cyclic custom file here, could you drop a couple lines of comment?
- I love the simplicity of initial solution, let's see if we can fix #14275 so fix for this ticket does not need to implement a workaround.
comment:7 Changed 9 years ago by
Status: | review_failed → assigned |
---|
comment:8 Changed 9 years ago by
Status: | assigned → review |
---|
Changes in t/13943.
- Tests simplified and moved to editor.js. Basically I think one test checking invalid custom config should be sufficient. As you suggested I adjusted this test and hope I didn't misunderstand you. If so let me know.
- Thanks to #14275 fix, workaround is only needed for IE8.
comment:9 Changed 9 years ago by
Milestone: | CKEditor 4.5.7 → CKEditor 4.5.8 |
---|
comment:10 Changed 9 years ago by
Milestone: | CKEditor 4.5.8 → CKEditor 4.5.9 |
---|
comment:11 Changed 9 years ago by
Milestone: | CKEditor 4.5.9 → CKEditor 4.5.10 |
---|
comment:12 Changed 8 years ago by
Milestone: | CKEditor 4.5.10 → CKEditor 4.5.11 |
---|
Moving tickets to the next milestone.
comment:13 Changed 8 years ago by
Milestone: | CKEditor 4.5.11 → CKEditor 4.6.1 |
---|
comment:14 Changed 8 years ago by
Milestone: | CKEditor 4.6.1 → CKEditor 4.6.2 |
---|
comment:15 Changed 8 years ago by
Milestone: | CKEditor 4.6.2 |
---|---|
Priority: | Normal → Nice to have (we want to work on it) |
Moving to the nice to have list.
Every config file defines a function like
When config file is loaded, CKEDITOR.editorConfig function is executed (it is defined by recently loaded config so for every config the corresponding function is executed once).
In this case when custom config file fails to load, the CKEDITOR.editorConfig function is called anyway but due to loading failure it still is the function defined in default config. The CKEDITOR.editorConfig from default config with this code
is executed twice and so male symbol is appended twice to specialCharcters.