Skip to content

Commit

Permalink
Use the url for drag and drop in TinyMCE (#36687)
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jan 25, 2022
1 parent 661fd26 commit ac81c31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ public function postFiles()
$name = $this->getModel()->createFolder($adapter, $name, $path, $override);
}

return $this->getModel()->getFile($adapter, $path . '/' . $name);
$options = [];
$options['url'] = $this->input->getBool('url', false);

return $this->getModel()->getFile($adapter, $path . '/' . $name, $options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
var _Joomla$getOptions = Joomla.getOptions('system.paths'),
rootFull = _Joomla$getOptions.rootFull;

urlPath = "" + response.data.thumb_path.split(rootFull)[1];
} else if (responseData.thumb_path) {
urlPath = "" + response.data.url.split(rootFull)[1];
} else if (responseData.url) {
// Absolute path for different domain
urlPath = responseData.thumb_path;
urlPath = responseData.url;
}

var dialogClose = function dialogClose(api) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public function onDisplay(
if ($dragdrop && $user->authorise('core.create', 'com_media'))
{
$externalPlugins['jdragndrop'] = HTMLHelper::_('script', 'plg_editors_tinymce/plugins/dragdrop/plugin.min.js', ['relative' => true, 'version' => 'auto', 'pathOnly' => true]);
$uploadUrl = Uri::base(false) . 'index.php?option=com_media&format=json&task=api.files';
$uploadUrl = Uri::base(false) . 'index.php?option=com_media&format=json&url=1&task=api.files';

if ($this->app->isClient('site'))
{
Expand Down

0 comments on commit ac81c31

Please sign in to comment.