boboldehampsink / export Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED - Export plugin for Craft CMS
License: MIT License
DEPRECATED - Export plugin for Craft CMS
License: MIT License
The title pretty much says it all
Clicking export works, showing the spinner, downloading the CSV, but nothing happens after that, it just stays there forever.
Craft CMS 2.6.2989
Export 0.5.10
Craft: 2.6.2944
Export: 0.5.10
Section Name: Products (Channel)
Entry Type(s): GenInfo, Notes
Field Group1: Summary, Description, Yadda0
Field Group2: Notes, Yadda1, Yadda2
Field Group3: MetaTitle, MetaDesc, MetaKeys
Initial Section->EntryType setup = Products->GenInfo
Fields = Group1
Initial Section->EntryType setup = Products->Notes
Fields = Group2
VERY FIRST EXPORT:
If I export Products->GenInfo->Ascending, all Group1 fields are available on "Choose which fields.." screen. All good.
If I add Field Group2 to Products->GenInfo, then go through exact same Export as first export:
Products->GenInfo->Ascending - the Field Group2 fields do NOT display in "Choose which fields..." screen.
If I change Export settings to Products->GenInfo->Descending - the Field Group2 fields DO display in "Choose which fields..." screen.
If I change Export settings to Products->ALL->(Ascending|Descending) the Field Group2 fields DO display...
From my extensive tests, it seems like the "Choose which fields..." screen is "caching" based on the first Export settings selected??? I've cleared cache, removed & added fields and field groups, removed and added data to fields, etc.
No matter what I change in the Fields or Sections, the "Choose which fields..." screen doesn't update to reflect those changes.
I see the _export_map.settings and _export_map.map values and can verify that the .map JSON "checked:" values DO update based on which fields I check for each Export test.
I removed all the rows in _export_map, started a new Export with same settings as VERY FIRST EXPORT above and the Group2 fields DO display.
Then ran through the full export, removed a field from the Products->GenInfo entry type and headed back to Exports... STILL shows in the "Choose which fields..." screen.
RESULTS OF EXTENSIVE TESTING:
The list of available Export fields DOES NOT update when fields are added/removed from the Section's EntryType. UNLESS I empty the _export_map table.
Hi,
I have entries in FR (French) and EN (English).
I tried to export and then import but it only imports the default locale for the entry.
How can I import all locales?
Thank you for your time.
Seems while im exporting the page is not responsive...as the export can take more than a couple of minutes...thats not so cool.
This isn't actually an issue but more of a comment. I modified ExportService.php to get the URL of images. I'll leave it here and perhaps it will help someone else. Thanks for the code, bro.
public function parseFieldData($handle, $data)
{
// Do we have any data at all
if (!is_null($data)) {
// Get field info
$field = craft()->fields->getFieldByHandle($handle);
// If it's a field ofcourse
if (!is_null($field)) {
// For some fieldtypes the're special rules
switch ($field->type) {
case ExportModel::FieldTypeAssets:
// Show names
if( $data instanceof ElementCriteriaModel)
{
//$imgSettings = array("mode"=> 'crop',
//"width" => "1600",
//"height"=> "230",
//"position" => "center-center");
$firstImage = $data->first();
if(isset($firstImage)){
$image =$firstImage->getUrl();
$data =$image;
}
}
break;
case ExportModel::FieldTypeEntries:
case ExportModel::FieldTypeCategories:
case ExportModel::FieldTypeUsers:
case ExportModel::FieldTypeTags:
// Show names
$data = $data instanceof ElementCriteriaModel ? implode(', ', $data->find()) : $data;
break;
case ExportModel::FieldTypeLightswitch:
// Make data human readable
switch ($data) {
case '0':
$data = Craft::t('No');
break;
case '1':
$data = Craft::t('Yes');
break;
}
break;
case ExportModel::FieldTypeTable:
// Parse table checkboxes
$table = array();
if (is_array($data)) {
foreach ($data as $row) {
// Keep track of column #
$i = 1;
// Loop through columns
foreach ($row as $column => $value) {
// Get column
$column = isset($field->settings['columns'][$column]) ? $field->settings['columns'][$column] : (isset($field->settings['columns']['col'.$i]) ? $field->settings['columns']['col'.$i] : array('type' => 'dummy'));
// Keep track of column #
++$i;
// Parse
$table[] = $column['type'] == 'checkbox' ? ($value == 1 ? Craft::t('Yes') : Craft::t('No')) : $value;
}
}
}
// Return parsed data as array
$data = $table;
break;
case ExportModel::FieldTypeRichText:
case ExportModel::FieldTypeDate:
case ExportModel::FieldTypeRadioButtons:
case ExportModel::FieldTypeDropdown:
// Resolve to string
$data = (string) $data;
break;
case ExportModel::FieldTypeCheckboxes:
case ExportModel::FieldTypeMultiSelect:
// Parse multi select values
$multi = array();
if (is_array($data)) {
foreach ($data as $row) {
$multi[] = $row->value;
}
}
// Return parsed data as array
$data = $multi;
break;
}
}
// Get other operations
craft()->plugins->call('registerExportOperation', array(&$data, $handle));
} else {
// Don't return null, return empty
$data = '';
}
// If it's an object or an array, make it a string
if (is_array($data)) {
$data = StringHelper::arrayToString(ArrayHelper::filterEmptyStringsFromArray(ArrayHelper::flattenArray($data)), ', ');
}
// If it's an object, make it a string
if (is_object($data)) {
$data = StringHelper::arrayToString(ArrayHelper::filterEmptyStringsFromArray(ArrayHelper::flattenArray(get_object_vars($data))), ', ');
}
return $data;
}
postDate and expiryDate only seem to bring out the date. Is it possible to bring out the time as well?
When creating an export of content with a link field an error is thrown.
mb_strlen() expects parameter 1 to be string, object given
`
/vagrant/craft/app/helpers/ArrayHelper.php(236)
224 // Private Methods
225 // =========================================================================
226
227 /**
228 * The array_filter() callback function for filterEmptyStringsFromArray().
229 *
230 * @param string $val
231 *
232 * @return bool
233 */
234 private static function _isNotAnEmptyString($val)
235 {
236 return (mb_strlen($val) != 0);
237 }
238 }`
The problem is that the link field contains objects like the Craft\ElementCriteriaModel object that are getting passed to the filterEmptyStringsFromArray method.
I think these should already be filtered out before passing it to the ArrayHelper class.
Hi
Have a strange issue with the file that is downloaded. When trying to open it in excel I get the following error:
The file format and extension of export.csv don't match The file could be corrupted or unsafe. When I proceed it tells me it is an SYLK file and can't be opened by excel.
Any ideas?
I am looking for some direction and I do see that the Todo’s in the readme include "Handle large exports more smoothly” which is my issue.
I have around 2k entries in a channel and when I try to export the entries, after a couple minutes of thinking about it, I get a dump of the comma delimited data and this error Fatal error: Maximum execution time of 0 seconds exceeded in ...craft/app/models/BaseModel.php on line 282
<--Not a ton of backend experience. I see line 282 is merging model attribute arrays, which I figure is the bulk of the work of plugin...
After exporting the users, the data for email and status fields are blank in the .csv file
I have different user groups and also additional fields too
I've got a checkbox-field with multiple options, but none of them are being exported. The value is always empty.
This means implementing an IExportElementType interface and support for more sources.
I'm using Export to export a users list which is working great for all custom user fields except a custom field of type Checkboxes, column values are blank in resulting CSV although column heading is present. Seems to be supported from looking at the code?
Column is rendered in the csv but no data from craft is populated into it.
When we export blog from craft then all field has been exported but body filed is matrix type field, which doesn't exports. return blank in body column
Hi there.
I've just had issues exporting data which uses fields beginning with title. e.g. titlePrefix, titleName. The exported data included these columns but not the data so the exported data was under the incorrect columns.
The cause is in services/Export_EntryService.php line 162. For now I've just renamed my field handles but a fix would be great.
Somehow exporting "Entries" fields and "Users" fields are empty in our CSV exports. We need the entry Title for the Entry relation and the username or first/last name for the User relation.
Would be cool if the field mapper will let us choose which field of the related entry should be exported by the way.
-- Thijs
When testing the export on a lot of entries (10000 in our client scenario) the export will crash. Craft can't handle that much data and will give a memory exceeded message. Is there a chance you'll come up with a solution where the users is able export the data into several parts?
First off really handy plugin.
Would it be possible to change/choose the separator from a comma to something like a pipe?
Reason being I have commas in some of my category names which is causing an issue.
Thanks
I've added and installed the plugin fine, but when I try to access the exporter I get the error:
'Internal Server Error
The function "getCsrfInput" does not exist'
I've tried enabling 'enableCsrfProtection' => true in settings which did not fix the problem, so not too sure if there is anything else within Craft that the exporter is dependant on? Or reasons that may cause this?
The plugin doesn't seem to export matrix data
...while exporting.
Not so clever. I know its probably because PHP / Apache runs on one thread.....still....not good.
Maybe for that process into own process?
Right now there is no possibility to export the URI just the slug?
This would make heaps of sense :)
The EntryType dropdown isn't repopulating based on user's selection when you go back in the browser.
Steps to reproduce:
I have a Plain Text field as part of an entry that does not show in the Export Configuration. I have changed the Field Name, I have also recreated the field and cleared the cache.
What could cause a field to be omitted? The field is in use.
I'm exporting values for multiple fields, some plain text (which works fine), and some table fields. In the CSV, for any table fields, the values of each row are added to the CSV cell twice.
For example, if I have a table field such as this:
Length | Width | Height |
---|---|---|
1 | 2 | 3 |
...it would export to the CSV like this:
1, 2, 3, 1, 2, 3
Am I missing a step, or can you give me any instruction on how to fix this? Thanks!
Hi Bob, I have a little question,
When I export data with Umlauts (ä, ü, ö), they don't get displayed correctly when I open the CSV file in excel. Is there any place where I can define the correct charset (UTF-8?) to use or something, so this doesn't happen? I am using a custom export service, so could I add something there?
Thanks...
Is there a way to export All entries including SINGLES?
Hello there,
Thank you for this great tool.
Is there a way of exporting single entries?
Maybe I'm missing something.
Thank you for your time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.