-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
How to enable two adapters in one build #569
Comments
First of all, if one wants to have both adapters enabled he should have a special "adapter" provided which will handle it. I have no idea how it supposes to work: some file types handled by one adapter, some by another? That's an edge case.
I wanted to say that this is a good idea, but then I realized that there no real difference between this and removing However, the editor may seem to be incomplete without any adapter, because there is no way to insert an image if no adapter is defined. Also, if each adapter will have its own warning it will be very misleading the user. Most probably he will not get that need to define only one and try to follow all warnings, wondering why he needs to configures that many URLs. This is why we should check in the |
You misunderstood that case. I was talking about developers who blindly or mistakenly configured both at the same time. This often happens if you do copy-paste from SO. We might want to warn those developers that they did something wrong. |
Good point.
I agree that this is the right place. A common warning logged by the
Thankfully we have error codes docs already (and |
So it seems to be done in https://github.com/ckeditor/ckeditor5-upload/issues/58. But now I need to check whether all this works when used in builds. |
OK, muting this error doesn't work for two reasons:
|
Hm... It's not that. At least, it does not seem so. Weird. |
OK, that's because |
Got confused with the talks here, but will leave my opinion here. There should be no warning if one uses our builds as is, with no configurations out of the box. |
You're right. There should be no warning. This means that we're back to square one. So, which option is better?
Above, we're talking about upload adapters. They are invisible to the user so, when not configured, they don't affect the editor in any way. However, there's also |
I'm for the first solution because it's simpler. The second one may be confusing because enabling a feature will require doing two things – enabling it and then configuring. However, generally speaking, proposing two upload adapters enabled in one build sounds bad to me ;/. But I guess we can't solve this in a batter way anyway. |
I would say "yes". Developers should be a few configurations away from having them working and I feel that the
Yes, no warning if any configuration is made. Developers will rely on the documentation for that, not on a console warning. Actually, no matter the option, the developer will always look at the documentation first (in the second option, to know that the plugin must be enabled), so the warning is really pointless, just like as having to enable the plugin manually (which just becomes an additional step to have things done).
The original idea is that we don't have it.
If the button is configured to be in the toolbar, then probably showing a warning is a good idea... or maybe an error when the button is clicked. |
Why do you think that EI + ImageButton makes no sense? 90% of the time I'm using the "upload" button in Slack to pick an image. |
I'll check if that wouldn't happen now. I think that a warning will be logged. |
Not sure if this is ok, but if we won't log a warning on startup then an error may still be logged when one pastes or drops an image. Is this acceptable? Sounds poorly to me ;/ This happens because the feature is unfortunately enabled. It just can't upload the image. |
The only alternative I can see is logging a warning specific for ImageUpload instead of the error that we get now (https://github.com/ckeditor/ckeditor5-upload/issues/59). Which is a small improvement anyway. So, I'm going with this. |
Sorry, my mistake. I was way too focused on thinking about the file manager on that button that I forgot about the file system integration. Ofc the button makes sense with EI as well, but not in a default setup. |
I don't think any error or warning should be ever shown. And in fact, although the plugin is loaded, the feature should not be enabled if there is no configuration set for it. |
OK, lacking time we agreed to not polish the cases in which warning is logged any further now. Especially, that there are little details which matter here like the fact that I reported https://github.com/ckeditor/ckeditor5-upload/issues/61 for the future. |
The status of things now is that an error is logged when image is dropped or pasted and when using the "Insert image" button. |
i have same error, please help me |
#567 assumes that we'll have two adapters enabled in all builds – the CKFinder's and CS's ones.
Currently:
So, we have a problem here.
afterInit()
if none of the adapters was configured (which can be discovered by the lack ofcreateAdapter()
callback). But this means that we'll be logging a warning if someone uses a CKEditor 5 Build but doesn't use the built-in upload functionality (which is often).Both options are quite bad.
So, maybe we should consider a third option – that the adapters will be available in builds, but will not be enabled by default. You'd enable one by using e.g.
config.extraPlugins = [ 'EasyImage' ]
. However, this is quite a lot of work for us because we don't yet support building in "extra available plugins", norconfig.extraPlugins
.If we had more time, I'd go with the 3rd option. But taken the time constraints the first option seems to be most feasible. However, it'd be good to have a long-term plan for that since going with 3rd option means doing breaking changes so we should schedule that for before 1.0.0.
cc @pjasiun @wwalc
PS. I skipped the problem with one adapter overriding the other one if both are configured. This is another problem and perhaps should be handled by a more capable factory – one which throws when overridden. I wonder, though, how important this issue may be. How many developers will, for some reason, configure both adapters. And I'm guessing that some will because C&P-based development is a popular approach.
The text was updated successfully, but these errors were encountered: