Export task is not cleared after file download #891
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#891
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The export task is not cleared after file download :
This issue is more related to Joomla than JCB, but it happens primarily on download tasks because it exits the controller instead of redirecting to the list view.
Here is simple fix that you can add to Joomla Components > Libs & Helpers > Global Admin Event
$doc = JFactory::getDocument();
$js = <<<JS
/**
Proper fix for Joomla.submitform() not clearing form.task.value after form submits
*/
[Component]_Joomla_submitform_original = Joomla.submitform;
Joomla.submitform = function(task, form, validate)
{
var return_value = [Component]_Joomla_submitform_original(task, form, validate);
// If page was not reloaded for any reason we also need to clear the task
// e.g. validation prevented submit or task was AJAX-based or the task was a file download
// This is need because this method is called without task in some cases, e.g. a change in view's filters !!
if (task)
{
if (!form) form = document.getElementById('adminForm');
if (form) form.task.value = '';
}
return return_value;
};
JS;
$doc->addScriptDeclaration($js);
Of course the best way would be to implement it in the compiler ;-)
Okay I agree that we must fix this.. it has bugged me for a long time. I need more details...