Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.3.3 #202

Merged
merged 26 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0abe1f0
Removed name from datasource, updated GravityFormsDataSource with all…
doekenorg Jul 9, 2024
97ab3d6
PHPStan fixes
doekenorg Aug 26, 2024
abb1c41
Remove need for inner composer.json
doekenorg Aug 26, 2024
cc3d645
Fix PHPStan issues
doekenorg Aug 27, 2024
9259e44
Fix typecast of title
doekenorg Sep 2, 2024
14c9acd
Fix Github Action
doekenorg Sep 2, 2024
aa5f8b6
Exclude PHPStan check in CI
doekenorg Sep 2, 2024
4678987
Revert "Remove need for inner composer.json"
doekenorg Sep 3, 2024
87f2795
Fix PHPStan for survey add-on
doekenorg Sep 3, 2024
ee95b8d
Update GitHub cache action version
doekenorg Sep 3, 2024
d723c7a
Update GitHub checkout action version
doekenorg Sep 3, 2024
8b6b3ed
Update CircleCI machine image
doekenorg Sep 3, 2024
d4ab8cc
Add polyfills for iconv and mbstring
doekenorg Sep 16, 2024
6eb8eb0
Merge pull request #200 from GravityKit/issue/196-phpofficephpspreads…
mrcasual Sep 16, 2024
2f23e1b
Merge branch 'develop' into issue/phpstan-fixes
zackkatz Sep 26, 2024
4e1565a
Update composer.lock
zackkatz Sep 26, 2024
f153c20
Merge pull request #198 from GravityKit/issue/phpstan-fixes
mrcasual Oct 13, 2024
c7f1242
Bump version to 2.3.2 & update changelog
mrcasual Oct 13, 2024
9209561
Make sure Fields class is loaded
doekenorg Oct 14, 2024
4ad832e
Ignore error messages on rendering
doekenorg Oct 14, 2024
e320f32
Update Version tags
doekenorg Oct 14, 2024
85ea5ac
Fix plugin icon color
doekenorg Oct 18, 2024
55cf4d5
Add force download hook
doekenorg Oct 28, 2024
83db8bd
Merge branch 'main' into develop
doekenorg Oct 28, 2024
ac27fd6
Update versions for release
doekenorg Oct 28, 2024
8fd52ff
Update readme [ci skip]
doekenorg Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gfexcel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: GravityExport Lite
* Version: 2.3.2
* Version: 2.3.3
* Plugin URI: https://gfexcel.com
* Description: Export all Gravity Forms entries to Excel (.xlsx) or CSV via a secret shareable URL.
* Author: GravityKit
Expand All @@ -28,7 +28,7 @@
}

if ( ! defined( 'GFEXCEL_PLUGIN_VERSION' ) ) {
define( 'GFEXCEL_PLUGIN_VERSION', '2.3.2' );
define( 'GFEXCEL_PLUGIN_VERSION', '2.3.3' );
}

if ( ! defined( 'GFEXCEL_MIN_PHP_VERSION' ) ) {
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Donate link: https://www.gravitykit.com/extensions/gravityexport/?utm_source=plu
Tags: Gravity Forms, GravityForms, Excel, Export, Entries
Requires at least: 4.0
Requires PHP: 7.2
Tested up to: 6.6.2
Stable tag: 2.3.2
Tested up to: 6.7
Stable tag: 2.3.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -256,6 +256,10 @@ You can hide a row by adding a hook. Checkout this example:

== Changelog ==

= 2.3.3 on October 28, 2024 =

* Enhancement: Added `gfexcel_field_fileuploads_force_download` hook, to disable the forced download links.

= 2.3.2 on October 14, 2024 =

* Fixed: Added compatibility for servers that miss the `iconv` or `mbstring` PHP extension.
Expand Down
2 changes: 1 addition & 1 deletion src/Addon/GravityExportAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public function feed_settings_fields(): array {
* @since 2.0.0
*/
public function get_menu_icon(): string {
return '<svg style="height: 24px; width: 37px;" enable-background="new 0 0 226 148" height="148" viewBox="0 0 226 148" width="226" xmlns="http://www.w3.org/2000/svg"><path d="m176.8 118.8c-1.6 1.6-4.1 1.6-5.7 0l-5.7-5.7c-1.6-1.6-1.6-4.1 0-5.7l27.6-27.4h-49.2c-4.3 39.6-40 68.2-79.6 63.9s-68.2-40-63.9-79.6 40.1-68.2 79.7-63.9c25.9 2.8 48.3 19.5 58.5 43.5.6 1.5-.1 3.3-1.7 3.9-.4.1-.7.2-1.1.2h-9.9c-1.9 0-3.6-1.1-4.4-2.7-14.7-27.1-48.7-37.1-75.8-22.4s-37.2 48.8-22.4 75.9 48.8 37.2 75.9 22.4c15.5-8.4 26.1-23.7 28.6-41.2h-59.4c-2.2 0-4-1.8-4-4v-8c0-2.2 1.8-4 4-4h124.7l-27.5-27.5c-1.6-1.6-1.6-4.1 0-5.7l5.7-5.7c1.6-1.6 4.1-1.6 5.7 0l41.1 41.2c3.1 3.1 3.1 8.2 0 11.3z"/></svg>';
return '<svg style="height: 24px; width: 37px;" fill="currentColor" enable-background="new 0 0 226 148" height="148" viewBox="0 0 226 148" width="226" xmlns="http://www.w3.org/2000/svg"><path d="m176.8 118.8c-1.6 1.6-4.1 1.6-5.7 0l-5.7-5.7c-1.6-1.6-1.6-4.1 0-5.7l27.6-27.4h-49.2c-4.3 39.6-40 68.2-79.6 63.9s-68.2-40-63.9-79.6 40.1-68.2 79.7-63.9c25.9 2.8 48.3 19.5 58.5 43.5.6 1.5-.1 3.3-1.7 3.9-.4.1-.7.2-1.1.2h-9.9c-1.9 0-3.6-1.1-4.4-2.7-14.7-27.1-48.7-37.1-75.8-22.4s-37.2 48.8-22.4 75.9 48.8 37.2 75.9 22.4c15.5-8.4 26.1-23.7 28.6-41.2h-59.4c-2.2 0-4-1.8-4-4v-8c0-2.2 1.8-4 4-4h124.7l-27.5-27.5c-1.6-1.6-1.6-4.1 0-5.7l5.7-5.7c1.6-1.6 4.1-1.6 5.7 0l41.1 41.2c3.1 3.1 3.1 8.2 0 11.3z"/></svg>';
}

/**
Expand Down
26 changes: 23 additions & 3 deletions src/Field/FileUploadField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* Class FileUploadField
*
* @since 1.1.0
*/
class FileUploadField extends BaseField implements RowsInterface {
Expand Down Expand Up @@ -51,7 +52,6 @@ public function getColumns() {
* @return bool Whether the uploads should be shown as a column.
*/
private function showFileUploadsAsColumn() {

// The default value of `true` will not be returned by get_plugin_setting(); it will return null by default.
// So we apply the ?? operator and return true as the default value.
$fileuploads_enabled = GravityExportAddon::get_instance()->get_plugin_setting( 'fileuploads_enabled' ) ?? true;
Expand Down Expand Up @@ -80,7 +80,9 @@ public function getRows( ?array $entry = null ): iterable {
}

foreach ( $files as $file ) {
yield $this->wrap( [ $this->field->get_download_url( $file, true ) ] );
yield $this->wrap( [
$this->field->get_download_url( $file, $this->should_force_download() ),
] );
}
}
} else {
Expand All @@ -98,6 +100,24 @@ protected function getFieldValue( $entry, $input_id = '' ) {
return $value;
}

return $this->field->get_download_url( $value, true );
return $this->field->get_download_url( $value, $this->should_force_download() );
}

/**
* Returns whether to force a download URL.
*
* @since 2.3.3
*
* @return bool Whether to force a download URL.
*/
private function should_force_download(): bool {
return (bool) gf_apply_filters(
[
'gfexcel_field_fileuploads_force_download',
$this->field->formId,
],
true,
$this->field
);
}
}