Open laryn opened 7 years ago
A related issue has been fixed https://github.com/backdrop/backdrop-issues/issues/2884, but data loss issue is still present.
Wondering if we could/should be saving a draft of the node, and then redirecting back to the draft once the redirect is created.
Another option - open the redirect form in a dialog.
In function redirect_field_attach_form():
if (redirect_access('create', 'redirect')) {
$form['redirect']['actions']['#links']['add'] = array(
'title' => t('Add URL redirect to this @type', array('@type' => backdrop_strtolower($info['label']))),
'href' => 'admin/config/urls/redirect/add',
'query' => array_filter($redirect) + backdrop_get_destination(),
'attributes' => array(
'class' => array('use-ajax'),
'data-dialog' => 'true',
),
);
}
The redirect after form submission could get tricky, though. So I wouldn't assume my example is working without more modifications in that function.
I like the dialog option. In the alpha version of Paragraphs with front end modal editing, the edit dialog allows changes and then closes the dialog and uses Ajax to refresh just the small portion of the page that was changed. Maybe we could do something similar here where just the Redirect section gets refreshed?
Another idea: Entity Connect has links to load an add/edit form for a separate entity, while editing an entity. It saves the current page in a cache somehow, loads the new form, and then redirects back to the original form reloaded after saving the other entity. (This sounds like what @klonos suggests above)
Describe your issue or idea
The "URL redirects" option in the bottom of the edit/create content screen gives no warning that it will jump to a new page. This should either give a warning to the current behavior or adapt the behavior to function on the same screen without jumping away.
Steps to reproduce (if reporting a bug)
Actual behavior (if reporting a bug)
Expected behavior (if reporting a bug)