-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[5.2] Add text context info for post request for dragging image in editor in article #39958
base: 5.2-dev
Are you sure you want to change the base?
Conversation
This is not needed at all. For all stages of the model there are corresponding events that actually have the context you are passing here but most importantly in order to tweak the core functionality you are forced to use a plugin thus the whole context idea here is useless. Please check the events here: #28886 |
|
I was doing that for over a decade and the process is the same although some things have changed in the j4 API: https://github.com/dgrammatiko/imageUploaderHelper
There are many ways to go, the easiest probably is to pass the needed data to the session so the plugin, when it executes, could reuse it. An example could be https://github.com/dgrammatiko/sloth-pkg/blob/8dbe65b679af8ad60c9f9ac36ee54b754300b17f/plg_sampledata/sloth.php#L179 There are other ways though. |
@korenevskiy Besides the above discussion: Can it be that you wanted to make this PR for the 4.3-dev branch but then by mistake have made it for the 4.2-dev branch? The PR shows 2044 changed files. |
Yes, you are completely right. I did PR for 4.3 dev, but after publishing the PR, for some reason unknown to me, he ended up in the 4.2 branch. I did PR on the site, without using code editors. |
@laoneo any thoughts here? |
@korenevskiy You can change the base branch to 4.3-dev by using the "Edit" button right beside the title of this PR on GitHub. After that you can change the base branch from 4.2-dev to 4.3-dev. Let me know if I shall help with doing that. |
Thank you, if I had known earlier, I wouldn't have created a lot of bad PR here. 👍👍 |
build/media_source/plg_editors_tinymce/js/plugins/dragdrop/plugin.es5.js
Outdated
Show resolved
Hide resolved
…gin.es5.js Co-authored-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
It looks like we will never get a tool for automatic image management. Plugins are originally designed to work with contextual data. Working with the session is not the task of the plugin, but the task of the kernel. This context is transmitted only by the plugin for which it is intended. In fact, plugins are blind when processing images. This is important information. Very important. |
Then make a proposal for those changes to be applied GLOBALLY. Adding sporadically different context, etc is making the system very unpredictable for devs. To be clear here, I'm not against adding more data, it's that this is not standardised, ie this event will be available only for tinyMCE drag and drop images, but not for any other editor and neither for tinyMCE if you upload a file using the media manager modal. Consistency is key... |
|
If you manage to cover the modal as well I'm positive on this. Also you need to add the missing code in the media manager that will pass the input data to the events on each adapter (which right now is missing and quite frankly the extra data is useless as is) |
In the case of a Media Manager, context is useless and unnecessary. Since the Media Manager does not carry information about the Article and Category. I.e., there is nothing to transmit in the context in the Media Manager. |
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible. |
This pull request has been automatically rebased to 5.1-dev. |
This pull request has been automatically rebased to 5.2-dev. |
When dragging an image in the article editor, a POST request is sent. I added a context with information about the article ID to this POST request. This will allow on the server side to give names to pictures with the content of the article ID. In general, it is useful for the component to know which article this picture belongs to.
Before POST/GET request
After Fix POST/GET request
This context will allow you to dynamically manage the saved files when inserting them into the article editor.
And how to find out the ownership and refactoring of a folder of pictures if it's just a bunch of sketched different files.
A specialist site manager in the modern world does not have to worry about the file name, the file should automatically be named itself and saved in the right directory. The site manager should only think about the description of the photo.
This PR does not provide new features. But it gives an additional line of information for plugins and components to implement broad functionality. If even now it will seem superfluous. Then in the near future, administrators will be able to at least download a plugin to manage the location of images. Now every social network uploads images simply. The user has nothing to do with the location of the images on the social network server. We have to take the same step in Joomla
I wanted to add this PR together with #39957 please support this PR