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

Add CSV Format search/replace to Search & Replace Tab #82

Merged
merged 5 commits into from
Jun 15, 2017

Conversation

gerbilOFdoom
Copy link

I've found myself in need of a bulk search/replace function for some time now to handle broken links that occur when importing a site from HTML to Wordpress. To that end, I've added a CSV option to the Search & Replace tab.

The CSV option's label is missing translations for German and Chinese.

Bryson Zimmerman added 5 commits April 18, 2017 22:36
Created CSV entry in Search & Replace tab
Pass csv data to replace_values function
Note: Change counter will only increment on cells changed and not number
of changes made in a cell
Missing: Multilingual support
CSV label now uses esc_html_e function. Updated default to no longer
include "(optional)" for improved readability.

Still lacking translation to other langauges.
@gerbilOFdoom
Copy link
Author

@devbanana Do you have thoughts on this pull request? I'd like to fix issues if they exist.

Copy link
Contributor

@bueltge bueltge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devbanana THe codex of the source is wrong. I added two hints an two examples, maybe you will fix this and add this to the pull request? Thanks a lot for your effort.

@@ -327,13 +337,17 @@ public function backup_table( $search = '', $replace = '', $table, $new_table_pr
//skip replace if no search pattern
//check if we need to replace something
//skip primary_key
if ( $search !== '' && $column !== $primary_key ) {
if ( $search !== '' && $column !== $primary_key && $column !== "guid") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always we use single quote mark, is much faster.


$edited_data = $this->replace->recursive_unserialize_replace(
$search, $replace,
$value
);

if($csv != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need whitespace, like in this example if ( $csv !== null ) { and also a identical usage, strict !== instead of ==.

@bueltge bueltge added this to the 3.2.0 milestone Jun 15, 2017
@bueltge bueltge modified the milestones: 3.1.3, 3.2.0 Jun 15, 2017
@bueltge bueltge changed the base branch from master to csv-format June 15, 2017 17:50
@bueltge bueltge merged commit afc7553 into wp-media:csv-format Jun 15, 2017
@bueltge
Copy link
Contributor

bueltge commented Jun 15, 2017

I merge this pull request in a new branch to fix the formatting issues.

bueltge added a commit that referenced this pull request Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants