Skip to content

Commit

Permalink
Added fallback when choosing static form with dynamic fields
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoJokhan committed Mar 8, 2023
1 parent 3303476 commit f707f3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cms/lib/modules/resource-form-widgets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ module.exports = {


widget.isTagSelected = function(tagId) {
if(!activeResource || !Array.isArray(activeResource.tags)) return false;
return activeResource.tags.findIndex(t => t.id === tagId) !== -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ $(document).ready(function () {

$(form).find('input[type="submit"]').each(function(index, button) {
oldButtonValues.push($(this).val());

if(button.id === "btnSaveAsConcept" && publishField.val()) {
$(this).val('Verzenden...');
} else if(!publishField.val()) {
Expand All @@ -206,6 +205,12 @@ $(document).ready(function () {
success:function(response) {
formHasChanged = false;
var redirect = $(form).find('.form-redirect-uri').val();

// for some reason when you select the dynamic form then the input field with class .form-redirect-uri is not within the form
if(!redirect) {
redirect = document.querySelector('.form-redirect-uri').value;
}

redirect = redirect.replace(':id', response.id);
redirect = window.siteUrl + redirect;

Expand Down

1 comment on commit f707f3e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/frontend:bugfix-tags-remember-choices-on-edit-idea-f707f3e

Please sign in to comment.