Skip to content

Commit

Permalink
Fix text-domain error during layout installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mwalek committed Aug 16, 2024
1 parent c5fa025 commit 2fe508d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/js/admin-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,7 @@

$.when( vcfg.server_request( 'install_product', {
id: $link.attr( 'data-download-id' ),
text_domain: $link.attr( 'data-template-text-domain' ),
activate: true,
} ) )
.then( on_success )
Expand Down
5 changes: 3 additions & 2 deletions includes/admin/metaboxes/views/select-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ static function ( array $mapping, string $key ) use ( $templates ) {
$selected = ( $id == $directory_template ) ? ' gv-selected' : '';
$placeholder = ! empty( $template['buy_source'] );
$is_included = ! empty( $template['included'] );
$plugin_data = GravityKit\GravityView\Foundation\Helpers\Core::get_installed_plugin_by_text_domain( $template['textdomain'] ?? '' ) ?: array();
$plugin_text_domain = $plugin_data['text_domain'] ?? '';
$template_text_domain = $template['textdomain'] ?? '';
$plugin_data = GravityKit\GravityView\Foundation\Helpers\Core::get_installed_plugin_by_text_domain( $template_text_domain ) ?: array();
$plugin_text_domain = $plugin_data['text_domain'] ?? $template_text_domain;
$button_text = empty( $plugin_data ) ? esc_html__( 'Install', 'gk-gravityview' ) : esc_html__( 'Activate & Select', 'gk-gravityview' );
$button_class = 'gv-layout-' . ( empty( $plugin_data ) ? 'install' : 'activate' );
$base_type = $base_template_mapping[ $template['slug'] ?? 'table' ] ?? 'default_table';
Expand Down

0 comments on commit 2fe508d

Please sign in to comment.