Skip to content
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

Orphaned files > file edit button > without action #1252

Open
SelfMan opened this issue Apr 25, 2023 · 3 comments
Open

Orphaned files > file edit button > without action #1252

SelfMan opened this issue Apr 25, 2023 · 3 comments

Comments

@SelfMan
Copy link

SelfMan commented Apr 25, 2023

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.

@SelfMan
Copy link
Author

SelfMan commented Apr 25, 2023

Addendum - Same blank page is shown if you don't select the action from the select box and hit the "Proceed" button.

@SelfMan
Copy link
Author

SelfMan commented Apr 25, 2023

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.

@SelfMan
Copy link
Author

SelfMan commented Apr 25, 2023

QUESTION: Is it a good idea to name a select element "action" while it is a "reserved" word for the

Tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant