Skip to content

Commit

Permalink
Release 2.19.3 (#1942)
Browse files Browse the repository at this point in the history
* Fixed: Using merge tags as values for search and start/end date
override settings was not working in Views embedded as a field
* Fixed: Deprecation notice in PHP 8.2+
  • Loading branch information
mrcasual authored Oct 25, 2023
2 parents 0692ee0 + 7558023 commit 47b5e67
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 97 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto-Add Pull Requests

on:
pull_request:
types:
- opened
- reopened
jobs:
add-to-project:
name: Add to GravityKit Planning
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/GravityKit/projects/16
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gravityview.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GravityView
* Plugin URI: https://www.gravitykit.com
* Description: The best, easiest way to display Gravity Forms entries on your website.
* Version: 2.19.2
* Version: 2.19.3
* Author: GravityKit
* Author URI: https://www.gravitykit.com
* Text Domain: gk-gravityview
Expand All @@ -27,7 +27,7 @@
/**
* The plugin version.
*/
define( 'GV_PLUGIN_VERSION', '2.19.2' );
define( 'GV_PLUGIN_VERSION', '2.19.3' );

/**
* Full path to the GravityView file
Expand Down
7 changes: 7 additions & 0 deletions includes/class-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ public function changelog_screen() {
* - If 4.28, include to 4.26.
*/
?>
<h3>2.19.3 on October 25, 2023</h3>

<ul>
<li>Fixed: Using merge tags as values for search and start/end date override settings was not working in Views embedded as a field</li>
<li>Fixed: Deprecation notice in PHP 8.2+</li>
</ul>

<h3>2.19.2 on October 19, 2023</h3>

<ul>
Expand Down
6 changes: 6 additions & 0 deletions includes/class-gravityview-placeholder-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
*/
class GravityView_Placeholder_Template extends GravityView_Template {

/**
* @since
* @var mixed|string The template ID.
*/
private $id;

function __construct( $id = 'template_placeholder', $settings = array() ) {

$default_template_settings = array(
Expand Down
16 changes: 8 additions & 8 deletions includes/fields/class-gravityview-field-gravityview_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,17 @@ public function field_options( $field_options, $template_id, $field_id, $context
static public function render_frontend( $field_settings, $context ) {
global $post;

$view_id = \GV\Utils::get( $field_settings, 'view_id', \GV\Utils::get( $field_settings, 'view_id' ) );
$view_id = $field_settings['view_id'] ?? null;
$form = $context->views->form->form ?? GFAPI::get_form( $field_settings['form_id'] ?? 0 );

if ( empty( $view_id ) ) {
if ( ! $view_id || ! $form ) {
return;
}

$attributes = '';

$page_size_value = \GV\Utils::get( $field_settings, 'page_size', 'default' );
$attributes .= ( 'default' === $page_size_value ) ? '' : sprintf( ' page_size="%d"', $page_size_value );
$attributes .= ( 'default' === $page_size_value ) ? '' : sprintf( ' page_size="%d"', $page_size_value );

// Prepare search field.
$search_field = \GV\Utils::get( $field_settings, 'search_field' );
Expand All @@ -174,8 +175,8 @@ static public function render_frontend( $field_settings, $context ) {

$search_value = \GV\Utils::get( $field_settings, 'search_value' );
if ( ! is_null( $search_value ) ) {
$search_value = GFCommon::replace_variables( $search_value, $context->form->form, $context->entry->as_entry() );
$attributes .= sprintf( ' search_value="%s"', esc_attr( $search_value ) );
$search_value = GFCommon::replace_variables( $search_value, $form, $context->entry->as_entry() );
$attributes .= sprintf( ' search_value="%s"', esc_attr( $search_value ) );
}

// Prepare search operator.
Expand All @@ -187,22 +188,21 @@ static public function render_frontend( $field_settings, $context ) {
// Start date
$start_date = \GV\Utils::get( $field_settings, 'start_date' );
if ( ! empty( $start_date ) ) {
$start_date = GFCommon::replace_variables( $start_date, $context->form->form, $context->entry->as_entry() );
$start_date = GFCommon::replace_variables( $start_date, $form, $context->entry->as_entry() );
$attributes .= sprintf( ' start_date="%s"', esc_attr( $start_date ) );
}

// End date
$end_date = \GV\Utils::get( $field_settings, 'end_date' );
if ( ! empty( $end_date ) ) {
$end_date = GFCommon::replace_variables( $end_date, $context->form->form, $context->entry->as_entry() );
$end_date = GFCommon::replace_variables( $end_date, $form, $context->entry->as_entry() );
$attributes .= sprintf( ' end_date="%s"', esc_attr( $end_date ) );
}

$shortcode = sprintf( '[gravityview id="%d" post_id="%d" %s /]', $view_id, $post->ID, trim( $attributes ) );

echo do_shortcode( $shortcode );
}

}

new GravityView_Field_GravityView_View;
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h

== Changelog ==

= 2.19.3 on October 25, 2023 =

* Fixed: Using merge tags as values for search and start/end date override settings was not working in Views embedded as a field
* Fixed: Deprecation notice in PHP 8.2+

= 2.19.2 on October 19, 2023 =

* Fixed: Merge tags were still not working in the Custom Content field after the fix in 2.19.1
Expand Down
84 changes: 2 additions & 82 deletions translations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-10-20T01:14:46+00:00\n"
"POT-Creation-Date: 2023-10-23T21:52:28+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Generator: WP-CLI 2.8.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Domain: gk-gravityview\n"

Expand Down Expand Up @@ -6653,83 +6653,3 @@ msgstr ""
#: future/includes/gutenberg/shared/js/server-side-render.js:171
msgid "The block did not render any content."
msgstr ""

#: future/includes/gutenberg/blocks/entry-field/block.json
msgctxt "block title"
msgid "GravityView Entry Field"
msgstr ""

#: future/includes/gutenberg/blocks/entry-field/block.json
msgctxt "block description"
msgid "Display an entry field value."
msgstr ""

#: future/includes/gutenberg/blocks/entry-field/block.json
#: future/includes/gutenberg/blocks/entry-link/block.json
#: future/includes/gutenberg/blocks/entry/block.json
#: future/includes/gutenberg/blocks/view-details/block.json
#: future/includes/gutenberg/blocks/view/block.json
msgctxt "block keyword"
msgid "GravityView"
msgstr ""

#: future/includes/gutenberg/blocks/entry-field/block.json
#: future/includes/gutenberg/blocks/entry-link/block.json
#: future/includes/gutenberg/blocks/entry/block.json
#: future/includes/gutenberg/blocks/view-details/block.json
msgctxt "block keyword"
msgid "form entry"
msgstr ""

#: future/includes/gutenberg/blocks/entry-field/block.json
#: future/includes/gutenberg/blocks/entry-link/block.json
#: future/includes/gutenberg/blocks/entry/block.json
#: future/includes/gutenberg/blocks/view-details/block.json
msgctxt "block keyword"
msgid "entry"
msgstr ""

#: future/includes/gutenberg/blocks/entry-link/block.json
msgctxt "block title"
msgid "GravityView Entry Link"
msgstr ""

#: future/includes/gutenberg/blocks/entry-link/block.json
msgctxt "block description"
msgid "Display a link to the GravityView entry."
msgstr ""

#: future/includes/gutenberg/blocks/entry/block.json
msgctxt "block title"
msgid "GravityView Entry"
msgstr ""

#: future/includes/gutenberg/blocks/entry/block.json
msgctxt "block description"
msgid "Display a GravityView entry."
msgstr ""

#: future/includes/gutenberg/blocks/view-details/block.json
msgctxt "block title"
msgid "GravityView View Details"
msgstr ""

#: future/includes/gutenberg/blocks/view-details/block.json
msgctxt "block description"
msgid "Display specific information about a GravityView View."
msgstr ""

#: future/includes/gutenberg/blocks/view/block.json
msgctxt "block title"
msgid "GravityView View"
msgstr ""

#: future/includes/gutenberg/blocks/view/block.json
msgctxt "block description"
msgid "Display a GravityView View."
msgstr ""

#: future/includes/gutenberg/blocks/view/block.json
msgctxt "block keyword"
msgid "view"
msgstr ""

0 comments on commit 47b5e67

Please sign in to comment.