Doeke Norg
Forum Replies Created
-
Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Change CSV CharsetHi @shogathu,
I looked into it, and you’re right that there isn’t a hook or filter for this. I currently see no way to make this happen, so I’ll try to add a filter for you next week. I’ll let you know when this is released.
Kind regards,
Doeke
@shogathu You are right, I missed the part where the download event is triggered before the entries are retrieved. I’ll look into a better event, maybe just after the download has been rendered.
In either case, I have a (slightly inelegant) solution for you.
$is_download = false; add_filter( 'gfexcel_event_download', function () use ( &$is_download ) { $is_download = true; } ); add_filter( 'gfexcel_output_search_criteria', function ( $criteria, $form_id, $feed_id ) use ( &$is_download ) { if ( ! $is_download ) { return $criteria; } $feed = GFAPI::get_feed( $feed_id ); if ( $feed instanceof WP_Error || ! ( $feed['is_active'] ?? 0 ) || ! $feed['meta'] ) { return $criteria; } $download_at = $feed['meta']['custom-downloaded_at'] ?? 0; if ( $download_at > 0 ) { $criteria['start_date'] = wp_date( 'Y-m-d H:i:s', $download_at ); } // Update feed for next download. $feed['meta']['custom-downloaded_at'] = wp_date( 'U' ); GFAPI::update_feed( $feed_id, $feed['meta'], $form_id ); return $criteria; }, 10, 3 );
So the idea is that we store a
custom-download_at
value on the feed. This way it is scoped to the feed, and not the entire form. Thegfexcel_download_event
only records that we are currently working with a download (and no other reason to retrieve the entries). Then thegfexcel_output_search_criteria
looks for this value. If we are downloading we see if we recorded acustom-download_at
time, and use that as astart_date
. After we updated the criteria, we also update that timestamp for the next download.Please note we need the “pass-by-reference”
&
-sign before the$is_download
to be able to track the changes of the value. Otherwise we would get a static value offalse
. And I’ve usecustom-download_at
because I think we will call the parameterdownload_at
on our end once the time comes. So this will avoid issues when updating later on.I hope this makes sense, and helps you out for now; so you can keep updating the plugins.
Kind regards,
Doeke
Hi @shogathu,
Thank you for reaching out.
Your situation is highly specific, even though I can see why you’d want to use it. However, most people actually want the entire list every time. So I think the way you’ve handled this is fine. There is one thing I would change, and that is to use the existing
gfexcel_event_download
hook. This is actually fired just before the actual download. At that point you can store a timestamp for that specific form.Then you can indeed use the
gfexcel_output_search_criteria
hook to exclude any entries before that timestamp.This question has triggered us to include a timestamp for the latest download in the feed settings. Once this has been added, you can use that value instead of storing it yourself with the
gfexcel_event_download
hook. Here is a link to the Github issue, so that you may keep an eye on that: https://github.com/GravityKit/GravityExport-Lite/issues/194. Unfortunately I can’t provide you with an ETA on this.Hope this helps you out for now.
Kind regards,
Doeke
GravityKitHey @muhammad_omer,
Glad you like it. ??
If you set up the export type as csv, you can select a single notification that will receive the single entry in csv format as an attachment on the notification.
Hope that helps.
Hi @charlesgodwin,
I’m sorry but unfortunately I haven’t had a chance to look into this. If your previous solution doesn’t work anymore with the latest release you can try and change
if ( $is_build ) {
toif ( false ) {
. This will avoid the declaring of the class aliases.I do believe this problem lies more in the other plugin, as they are not scoping the PHP spreadsheet dependency.
I can (maybe) only fix the incompatibility to our plugin, but they can fix it against every plugin. And I think that is a better solution.
Hy @erdoslaszlo,
You can remove the enclosure by adding the following snippet to your theme’s
functions.php
or using a snippet plugin:add_filter( 'gfexcel_renderer_csv_enclosure', '__return_null' );
However, please be careful with this; as any other comma’s that do end up in the output will be seen as delimiters; making for weird output.
To change the delimiter you can use the
gfexcel_renderer_csv_delimiter
-hook. To change it to a semi-colon for example, you would need the following code:add_filter( 'gfexcel_renderer_csv_delimiter', function() { return ';'; } );
I hope this helps you out.
Kind regards,
Doeke
@astrod00d Could you send the json export of both your forms to [email protected]? I’ll check them out and see if I can recreate the issue on my side. Thanks!
Kind regards,
Doeke
Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Can’t generate csv if has nested formHi @kaelxu sorry to hear that. Could you send a json export of the forms to [email protected] ? I’ll take a look if I can recreate the issue; and figure out where it comes from.
Kind regards,
Doeke
Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Download link missingAh! That download link is only visible if the download is activated. By default the download is deactivated for security purposes. When you visit the Gravity Export (Lite) button under
Settings
for that form; you should be able to activate the download there.Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Download link missing@charlesgodwin this is not advisable. By changing that parameter, gravityexport-lite is now dependent on the CBX plugin. It may also have unforseen side effects. Also, gravity export (pro) will not work this way.
I’ll try to reproduce this myself and come with a fix that will work, while keeping gravity export lite up to date.
Hi @charlesgodwin,
Sorry to hear this. Unfortunately we were forced to namespace the PHPSpreadsheet library to our own namespace; to avoid collisions with other plugins that use the same dependency. It is therefor not advised to use underlaying packages of the plugin.
In order to avoid breaking changes for customers who use the old namespaces, we create aliases for the old namespace to the new one. It is possible this is interfering with your plugin.
Could you test if removing the creation of these aliases fixes your problem? (it can be removed from the main GravityExport Lite plugin file).
If that works, please let me know; I can make these aliases optional.
We do check if the classes can be aliased; which probably means our plugin is loaded before the other one.
So, maybe you can change the order of which they are included?
In any case, if you have influence on the CBX plugin, that should probably also scope PHPSpreadsheet into their own name space. The problem that can arise, and has arisen, is that multiple versions of the same library are active. And those can conflict with each other. Therefor a custom namespace is best to avoid those collisions.
Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Spit data to multi rowsHi @gregwidow. Yes this is possible, although not the row merging like in your example, but it will have multiple rows per entry. This is part of the GravityExport (pro) add-on.
You can find it, and more information on https://www.gravitykit.com/products/gravityexport
Black Friday has come and gone, but if you use the discount code
NOTTOOLATE
you can still claim that discount.Hope this helps you out. Kind regards, Doeke
Forum: Plugins
In reply to: [GravityExport Lite for Gravity Forms] Site Health errorhi @dgomez Yes, this function is in the
phpspreadsheet
package that our plugin uses under the hood. However; the method that triggers this particular function is not used.Do you still have this error if you disabled the plugin? If so; it is triggered elsewhere. Please let us know.
Kind regards,
Doeke
GravityKit@ringringhello could you send the file to [email protected]? I cannot download the file from this URL, as it forces me to read it online ??