Skip to content

Commit

Permalink
Fix Widget configuration on new View (#2175)
Browse files Browse the repository at this point in the history
When creating a new View, you can add Widgets to the areas, but you
cannot configure them. This is because Ajax request requires at least a
template-id, which is not provided; as the value is empty.

This PR addresses this, and updates the `templateid` and `formid` for
all the widget buttons. This provided the required context for being
able to configure the widgets.

💾 [Build
file](https://www.dropbox.com/scl/fi/42cqpwesji1wj5b5d28nh/gravityview-2.30.1-1346fa760.zip?rlkey=tasx2cl2hzfo48ao3piymzxzt&dl=1)
(1346fa7).
  • Loading branch information
mrcasual authored Oct 21, 2024
2 parents 9e71d4c + 1346fa7 commit bbe5db5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions assets/js/admin-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,11 @@
$( '#directory-header-widgets' ).html( content.header );
$( '#directory-footer-widgets' ).html( content.footer );
$( '#directory-active-fields' ).append( content.directory );

// Update the template and form ID for all [data-templateid] buttons.
$( '#directory-header-widgets a[data-templateid], #directory-footer-widgets a[data-templateid]' )
.attr( 'data-templateid', data.template_id )
.attr( 'data-formid', data.form_id );
}

if ( update_single ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin-views.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h
= develop =

Fixed: Settings paged showed an undefined settings tab when the GravityView Settings tab was disabled.
Fixed: Widgets could not be configured on a new unsaved View.

= 2.30.1 on October 15, 2024 =

Expand Down

0 comments on commit bbe5db5

Please sign in to comment.