Merge pull request #1215 from ArthurHoaro/hotfix/tag-deletion
Fix a JS bug preventing AJAX tag deletion to work
This commit is contained in:
commit
a4fbe88b6d
2 changed files with 3 additions and 2 deletions
|
@ -548,7 +548,7 @@ function init(description) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const block = findParent(event.target, 'div', { class: 'tag-list-item' });
|
const block = findParent(event.target, 'div', { class: 'tag-list-item' });
|
||||||
const tag = block.getAttribute('data-tag');
|
const tag = block.getAttribute('data-tag');
|
||||||
const refreshedToken = document.getElementById('token');
|
const refreshedToken = document.getElementById('token').value;
|
||||||
|
|
||||||
if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
|
if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
|
|
|
@ -1084,7 +1084,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
|
||||||
die(t('Wrong token.'));
|
die(t('Wrong token.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), escape($_POST['totag']));
|
$toTag = isset($_POST['totag']) ? escape($_POST['totag']) : null;
|
||||||
|
$alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), $toTag);
|
||||||
$LINKSDB->save($conf->get('resource.page_cache'));
|
$LINKSDB->save($conf->get('resource.page_cache'));
|
||||||
foreach ($alteredLinks as $link) {
|
foreach ($alteredLinks as $link) {
|
||||||
$history->updateLink($link);
|
$history->updateLink($link);
|
||||||
|
|
Loading…
Reference in a new issue