Orphaned files > file edit button > without action
When orphaned files are listed, the list contains the file_edit button. When the button is clicked, only 2 variables are "Posted" to the server "action" and "files[]". The action variable is empty/not set. files[] contans the file name of the file. The result is that the page is just blank. Nothing happens. the \import-orphans.php file dos not contain any "empty" action path. The page should return to the list of orphaned files if action is not specified. The switch ($_POST['action']) does not have a default behavior for empty or invalid action.
The button itself should invoke the import action. The same way the actions form does. But only on the one file where the button is placed.
Addendum - Same blank page is shown if you don't select the action from the select box and hit the "Proceed" button.
proposed fix for the button: /assets/src/js/pages/import_orphans.js /assets/js/app.js
modify: $(this).parents('tr').find('td .select_file_checkbox').prop('checked', true); $("#import_orphans").submit(); to: $(this).parents('tr').find('td .select_file_checkbox').prop('checked', true); $("#action").val("import"); // force import action in select menu $("#import_orphans").submit();
For the "Proceed" button a alert() if $("#action") value is empty.
QUESTION: Is it a good idea to name a select element "action" while it is a "reserved" word for the