Skip to content

Commit

Permalink
Merge pull request #1067 from gravityview/develop
Browse files Browse the repository at this point in the history
Version 2.0.7.1
  • Loading branch information
zackkatz authored May 24, 2018
2 parents 27d97bc + 4ef2cbe commit 14e1a27
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-wp-i18n');

// Regular CSS/JS/Image Compression stuff
grunt.registerTask( 'default', [ 'exec:bower', 'sass', 'uglify', 'imagemin', 'watch' ] );
grunt.registerTask( 'default', [ 'exec:bower', 'sass', 'uglify', 'imagemin', 'translate', 'watch' ] );

// Translation stuff
grunt.registerTask( 'translate', [ 'exec:transifex', 'potomo', 'addtextdomain', 'makepot' ] );
Expand Down
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://gravityview.co
* Description: The best, easiest way to display Gravity Forms entries on your website.
* Version: 2.0.7
* Version: 2.0.7.1
* Author: GravityView
* Author URI: https://gravityview.co
* Text Domain: gravityview
Expand All @@ -22,7 +22,7 @@
/**
* The plugin version.
*/
define( 'GV_PLUGIN_VERSION', '2.0.7' );
define( 'GV_PLUGIN_VERSION', '2.0.7.1' );

/**
* Full path to the GravityView file
Expand Down
8 changes: 8 additions & 0 deletions includes/class-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ public function changelog_screen() {
</ul>
</div>

<h3>2.0.7.1 on May 24, 2018</h3>

<ul>
<li>Fixed: Merge Tags not being shown in Custom Content fields in Edit Entry</li>
<li>Fixed: "gvGlobals not defined" JavaScript error on Edit Entry screen affecting some themes</li>
<li>Fixed: Don't clear Search Bar configuration when switching View layouts</li>
</ul>

<h3>2.0.7 on May 23, 2018</h3>
<ul>
<li>Fixed: Entry visibility when View is embedded</li>
Expand Down
14 changes: 5 additions & 9 deletions includes/extensions/edit-entry/class-edit-entry-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,12 @@ private function print_scripts() {

wp_register_script( 'gform_gravityforms', GFCommon::get_base_url().'/js/gravityforms.js', array( 'jquery', 'gform_json', 'gform_placeholder', 'sack', 'plupload-all', 'gravityview-fe-view' ) );

GFFormDisplay::enqueue_form_scripts($gravityview_view->getForm(), false);
GFFormDisplay::enqueue_form_scripts( $gravityview_view->getForm(), false);

wp_localize_script( 'gravityview-fe-view', 'gvGlobals', array( 'cookiepath' => COOKIEPATH ) );

// Sack is required for images
wp_print_scripts( array( 'sack', 'gform_gravityforms' ) );
wp_print_scripts( array( 'sack', 'gform_gravityforms', 'gravityview-fe-view' ) );
}


Expand Down Expand Up @@ -297,11 +299,6 @@ private function process_save() {

gravityview()->log->debug( 'Submission is valid.' );

/**
* @hack This step is needed to fix field visibility, to add the calculation fields
*/
$form = $this->form_prepare_for_save();

/**
* @hack This step is needed to unset the adminOnly from form fields, to add the calculation fields
*/
Expand Down Expand Up @@ -1214,7 +1211,7 @@ private function get_field_value( $field ) {

// saved field entry value (if empty, fallback to the pre-populated value, if exists)
// or pre-populated value if not empty and set to override saved value
$field_value = !gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;
$field_value = isset( $this->entry[ $id ] ) && ! gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;

// in case field is post_category but inputType is select, multi-select or radio, convert value into array of category IDs.
if ( 'post_category' === $field->type && !gv_empty( $field_value, false, false ) ) {
Expand Down Expand Up @@ -1641,7 +1638,6 @@ private function filter_fields( $fields, $configured_fields ) {

/** @var GF_Field $field */
foreach ( $fields as $field ) {

if( intval( $configured_field['id'] ) === intval( $field->id ) && $this->user_can_edit_field( $configured_field, false ) ) {
$edit_fields[] = $this->merge_field_properties( $field, $configured_field );
break;
Expand Down
6 changes: 3 additions & 3 deletions includes/fields/class-gravityview-field-custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function field_options( $field_options, $template_id, $field_id, $context, $inpu
*
* @return GF_Field[] If Custom Content field exists, returns fields array with the fields inserted. Otherwise, returns unmodified fields array.
*/
public function show_field_in_edit_entry( $fields, $edit_fields = null, $form, $view_id ) {
public function show_field_in_edit_entry( $fields, $edit_fields = null, $form, $view_id = 0 ) {

// Not configured; show all fields.
if ( is_null( $edit_fields ) ) {
Expand All @@ -98,7 +98,7 @@ public function show_field_in_edit_entry( $fields, $edit_fields = null, $form, $
$new_fields = array();
$i = 0;

$entry = GravityView_View::getInstance()->getCurrentEntry();
$entry = gravityview()->request->is_edit_entry();

// Loop through the configured Edit Entry fields and add Custom Content fields if there are any
// TODO: Make this available to other custom GV field types
Expand All @@ -114,7 +114,7 @@ public function show_field_in_edit_entry( $fields, $edit_fields = null, $form, $

// Replace merge tags in the content
foreach ( $field_data as $key => $field_datum ) {
$field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry, false, false );
$field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry->as_entry(), false, false );
}

$field_data['cssClass'] = \GV\Utils::get( $edit_field, 'custom_class' );
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.on( 'click', ".widget[id*='"+ wp_widget_id +"'] input.widget-control-save", gvSearchWidget.saveWidget )

// [View] hook on assigned form/template change to clear cache
.on( 'change', '#gravityview_form_id, #gravityview_directory_template', gvSearchWidget.clearViewSearchData )
.on( 'change', '#gravityview_form_id', gvSearchWidget.clearViewSearchData )

// [WP widget] hook on assigned view id change to clear cache
.on( 'change', '#gravityview_view_id', gvSearchWidget.clearWidgetSearchData );
Expand Down Expand Up @@ -663,7 +663,7 @@

/**
* [Specific for View Search Widget]
* When form or template change, clear the select fields cache and remove all the search_bar configs
* When form changes, clear the select fields cache and remove all the search_bar configs
*/
clearViewSearchData: function() {
gvSearchWidget.selectFields = null;
Expand Down
36 changes: 18 additions & 18 deletions languages/gravityview.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the GPLv2 or later.
msgid ""
msgstr ""
"Project-Id-Version: GravityView 2.0.6.1\n"
"Project-Id-Version: GravityView 2.0.7.1\n"
"Report-Msgid-Bugs-To: https://gravityview.co/support/\n"
"POT-Creation-Date: 2018-05-08 22:37:16+00:00\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -224,7 +224,7 @@ msgstr ""
#: includes/class-gravityview-entry-link-shortcode.php:210
#: includes/extensions/edit-entry/class-edit-entry-admin.php:58
#: includes/extensions/edit-entry/class-edit-entry-admin.php:116
#: includes/extensions/edit-entry/class-edit-entry-render.php:898
#: includes/extensions/edit-entry/class-edit-entry-render.php:895
#: includes/extensions/edit-entry/fields/edit_link.php:14
#: templates/fields/field-edit_link-html.php:23
msgid "Edit Entry"
Expand Down Expand Up @@ -1482,23 +1482,23 @@ msgstr ""
msgid "What&rsquo;s New"
msgstr ""

#: includes/class-admin-welcome.php:474
#: includes/class-admin-welcome.php:487
msgid "View change history"
msgstr ""

#: includes/class-admin-welcome.php:495
#: includes/class-admin-welcome.php:508
msgid "GravityView is brought to you by:"
msgstr ""

#: includes/class-admin-welcome.php:530
#: includes/class-admin-welcome.php:543
msgid "Contributors"
msgstr ""

#: includes/class-admin-welcome.php:555
#: includes/class-admin-welcome.php:568
msgid "Want to contribute?"
msgstr ""

#: includes/class-admin-welcome.php:556
#: includes/class-admin-welcome.php:569
msgid ""
"If you want to contribute to the code, %syou can on Github%s. If your "
"contributions are accepted, you will be thanked here."
Expand Down Expand Up @@ -1872,7 +1872,7 @@ msgid "The request was invalid. Refresh the page and try again."
msgstr ""

#: includes/class-gravityview-entry-approval.php:140
#: includes/extensions/edit-entry/class-edit-entry-render.php:1896
#: includes/extensions/edit-entry/class-edit-entry-render.php:1892
msgid "You do not have permission to edit this entry."
msgstr ""

Expand Down Expand Up @@ -1984,39 +1984,39 @@ msgstr ""
msgid "Make field editable to:"
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:951
#: includes/extensions/edit-entry/class-edit-entry-render.php:948
msgid "There was a problem with your submission."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:951
#: includes/extensions/edit-entry/class-edit-entry-render.php:948
msgid "Errors have been highlighted below."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:957
#: includes/extensions/edit-entry/class-edit-entry-render.php:954
msgid "Entry Updated. %sReturn to Entry%s"
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1095
#: includes/extensions/edit-entry/class-edit-entry-render.php:1092
msgid "You don&rsquo;t have permission to edit this post."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1102
#: includes/extensions/edit-entry/class-edit-entry-render.php:1099
msgid "This field is not editable; the post no longer exists."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1455
#: includes/extensions/edit-entry/class-edit-entry-render.php:1452
msgid "Maximum number of files reached"
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1890
#: includes/extensions/edit-entry/class-edit-entry-render.php:1886
msgid "The link to edit this entry is not valid; it may have expired."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1900
#: includes/extensions/edit-entry/class-edit-entry-render.php:1896
msgid "You cannot edit the entry; it is in the trash."
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1940
#: includes/extensions/edit-entry/class-edit-entry-render.php:1936
msgid "You do not have permission to edit this field."
msgstr ""

Expand Down Expand Up @@ -3396,7 +3396,7 @@ msgctxt "User capability"
msgid "Entry Creator"
msgstr ""

#: includes/extensions/edit-entry/class-edit-entry-render.php:1916
#: includes/extensions/edit-entry/class-edit-entry-render.php:1912
msgctxt "Link shown when invalid Edit Entry link is clicked"
msgid "Go back."
msgstr ""
Expand Down
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Beautifully display your Gravity Forms entries. Learn more on [gravityview.co](h

== Changelog ==

= 2.0.7.1 on May 24, 2018 =

* Fixed: Merge Tags not being shown in Custom Content fields in Edit Entry
* Fixed: "gvGlobals not defined" JavaScript error on Edit Entry screen affecting some themes
* Fixed: Don't clear Search Bar configuration when switching View layouts

= 2.0.7 on May 23, 2018 =

* Fixed: Entry visibility when View is embedded
Expand Down

0 comments on commit 14e1a27

Please sign in to comment.