Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix table name token not being used in SQL exports even when only one…
… table is selected
  • Loading branch information
dmoagx committed Oct 24, 2015
1 parent 6f82431 commit e7cf9cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/SPExportFilenameUtilities.m
Expand Up @@ -149,6 +149,8 @@ - (void)updateAvailableExportFilenameTokens
}

[exportCustomFilenameTokenPool setObjectValue:exportTokens];
//update preview name as programmatically changing the exportCustomFilenameTokenField does not fire a notification
[self updateDisplayedExportFilename];
}

/**
Expand Down
3 changes: 2 additions & 1 deletion Source/SPExportInitializer.m
Expand Up @@ -304,7 +304,8 @@ - (void)exportTables:(NSArray *)exportTables orDataArray:(NSArray *)dataArray
[sqlExporter setSqlExportTables:exportTables];

// Create custom filename if required
[exportFilename setString:(createCustomFilename) ? [self expandCustomFilenameFormatUsingTableName:nil] : [self generateDefaultExportFilename]];
NSString *selectedTableName = (exportSource == SPTableExport && [exportTables count] == 1)? [[exportTables objectAtIndex:0] objectAtIndex:0] : nil;
[exportFilename setString:(createCustomFilename) ? [self expandCustomFilenameFormatUsingTableName:selectedTableName] : [self generateDefaultExportFilename]];

// Only append the extension if necessary
if (![[exportFilename pathExtension] length]) {
Expand Down

0 comments on commit e7cf9cd

Please sign in to comment.