Export issue since update
-
I haven’t made any changes to my reports, but some employees pointed out that suddenly, the export function doesn’t work. I’ve tried changing the Token, but I get a “file not found” error on every attempt to export.
-
Also: I’ve cleared out the exports directory (it was full of old exports) and when I run a new export, the file is there, but I still get a ‘file not found.’ message.
Are you using a custom export directory / export filename?
I have the same problem since the update. Not using a custom directory or filename.
The reports are created and are in the WP-Content/exports directory. If I modify the export URL that leads to a “file not found” error so that it’s a direct link, I am able to get the file.
So, THIS doesn’t work:
http://sub.mysite.url/wp-content/plugins/exports-and-reports/wp-admin-ui/Admin.class.php?download=1&_wpnonce=e9c4431400&export=events_for_check_us_out_04-06-2015_08-34-19_462in.csvBut this works:
http://sub.mysite.url/wp-content/exports/events_for_check_us_out_04-06-2015_08-34-19_462in.csvAlso, nothing custom and everything was working perfectly for a good long while. None of these are new reports and all have been in use for months.
I have the same problem since update.
Also been having this issue since the update. It seems as though the link to the exports folder is broken. I was able to access the folder correctly, and I’m not sure if exports were always in the wp-content folder or within the plugin folder or not.
I created a ticket but was unable to tie it to the plugin (It’s not listed in the dropdown?)
I’m looking to fix this issue in the next few days / week. Watch for the next version release soon.
Thanks for everyone’s patience.
This is a pretty easy fix. The issue is in the Admin.class.php file which is found here:
/wp-content/plugins/exports-and-reports/wp-admin-ui/Admin.class.php
There is an attempt to utilize a WordPress constant (WP_CONTENT_DIR) before the WordPress environment is loaded. These lines:
if ( ! defined( 'WP_ADMIN_UI_EXPORT_DIR' ) ) { define( 'WP_ADMIN_UI_EXPORT_DIR', WP_CONTENT_DIR . '/exports' ); }
Should be moved below the wp-load.php block. The final code should look like this:
global $wpdb; if(!is_object($wpdb)) { ob_start(); if(file_exists(realpath('../../../../wp-load.php'))) require_once(realpath('../../../../wp-load.php')); else require_once(realpath('../../../wp-load.php')); ob_end_clean(); } if ( ! defined( 'WP_ADMIN_UI_EXPORT_DIR' ) ) { define( 'WP_ADMIN_UI_EXPORT_DIR', WP_CONTENT_DIR . '/exports' ); }
That works like a charm! Thanks!
The above fix does not work for me and I am unsure as to why. Though in the end a fix that requires editing the base wordpress files is not an ideal solution for a plugin.
In my debugging I have found that WP_ADMIN_UI_EXPORT_DIR is not defined before the admin.php file loads and when exporting the file I am unsure if WP_CONTENT_DIR is ever defined. I have tried to use different vars but have been unsuccessful in finding a fix that can be applied just to this plugin without changing something in the wordpress code.
keneucker –
You have apparently altered the wrong file.
The one that needs this change affects only this plugin, not any WP core files.
This simple fix works perfectly.@keneucker is correct in saying that WordPress core and plug-in files should not be altered, except by their respective authors. In this case however the issue with the plug-in is pretty clear, the author acknowledged the bug, and has indicated it will be fixed in the next release. The updated version of the plug-in will presumably have a fix similar to the one I outlined previously and everything should continue to function normally post-update.
Glad to hear that the hotfix is working for people.
How to stop update of plugin Exports and Reports. I have written some custom code to do the needful.
Could you please advise where and what i have to write to avoid update of this plugin.
- The topic ‘Export issue since update’ is closed to new replies.