diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index ce8dc7ef44..bc36a73b28 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -102,8 +102,15 @@ $(document).ready(function(){ row.empty() row.html(""); } else { - // just remove this row completely - the removal of the hidden input will remove it from the array on post - row.remove() + if (table.children('tr.row-data').length) { + // this isn't the last row - we can just remove it + row.remove() + } else { + // this is the last row, we can't remove it completely since we need to post an empty array + row.empty() + row.html(""); + } // we need to fire a change event on one of the remaining inputs so that the sidebar badge is updated badgeSidebarForDifferences($(table)) diff --git a/domain-server/src/DomainServerSettingsManager.cpp b/domain-server/src/DomainServerSettingsManager.cpp index 6a63168579..0feaeefe37 100644 --- a/domain-server/src/DomainServerSettingsManager.cpp +++ b/domain-server/src/DomainServerSettingsManager.cpp @@ -295,6 +295,8 @@ void DomainServerSettingsManager::updateSetting(const QString& key, const QJsonV void DomainServerSettingsManager::recurseJSONObjectAndOverwriteSettings(const QJsonObject& postedObject, QVariantMap& settingsVariant, const QJsonArray& descriptionArray) { + + qDebug() << postedObject; // Iterate on the setting groups foreach(const QString& groupKey, postedObject.keys()) { QJsonValue groupValue = postedObject[groupKey];