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

Unable to upload via csv or paste raw csv #58

Open
daygon2007 opened this issue Sep 24, 2015 · 5 comments
Open

Unable to upload via csv or paste raw csv #58

daygon2007 opened this issue Sep 24, 2015 · 5 comments

Comments

@daygon2007
Copy link

I am unable to upload via csv or copy/paste raw csv. Not sure if it's my formatting or not but it keeps saying it's found the right amount of redirects but they all fail. I've tried different combinations and have not been able to get any of them to work.

Below are combinations I've tried using a real example:

blog/dont-let-grinch-steal-christmas/;[[~1447]]
blog/dont-let-grinch-steal-christmas/;[[~1447]];
blog/dont-let-grinch-steal-christmas/;[[~1447]];;

"blog/dont-let-grinch-steal-christmas/;[[~1447]]"
"blog/dont-let-grinch-steal-christmas/;[[~1447]];"
"blog/dont-let-grinch-steal-christmas/;[[~1447]];;"

blog/dont-let-grinch-steal-christmas/;[[~1447]],
blog/dont-let-grinch-steal-christmas/;[[~1447]];,
blog/dont-let-grinch-steal-christmas/;[[~1447]];;,

"blog/dont-let-grinch-steal-christmas/;[[~1447]]",
"blog/dont-let-grinch-steal-christmas/;[[~1447]];",
"blog/dont-let-grinch-steal-christmas/;[[~1447]];;",

"blog/dont-let-grinch-steal-christmas/;[[~1447]],"
"blog/dont-let-grinch-steal-christmas/;[[~1447]];,"
"blog/dont-let-grinch-steal-christmas/;[[~1447]];;,"

This is what I get when I do a print_r on for the array:
(Array
(
[0] => Array
(
[0] => blog/dont-let-grinch-steal-christmas/
[1] => [[~1447]]
[2] =>
)

)
{"success":true,"message":"Total 1 records found. Imported: 0 successful and 1 failed!","total":0,"data":[],"object":[]})

screen shot 2015-09-25 at 11 08 50 am

Any help or guidance would be awesome.

Bulk upload would be really awesome because I have over 700 redirects to put in place.

@nickff
Copy link

nickff commented Sep 27, 2016

@daygon2007 Did you ever figure this one out? Let me know!

@daygon2007
Copy link
Author

daygon2007 commented Sep 27, 2016

@nickff no unfortunately I had to do all 700+ imports 1 by 1 :( 👎

@getandyjones
Copy link

I cannot import CSV or paste raw data either - any update on this?

@labr1005
Copy link

Yeah, I just ran into this, too. The validation for target (and pattern) currently only checks for a valid resource uri: https://github.com/modxcms/Redirector/blob/develop/core/components/redirector/processors/mgr/import/import.class.php#L111

Regular expressions and MODX tags will always fail for target and pattern.

@daygon2007
Copy link
Author

daygon2007 commented Jun 7, 2018

@labr1005 Thanks for catching that. That helped me out a lot because we're migrating part of our site to another install on a sub domain, so what i did was create a snippet to setup a php 301 redirect...

Here's the snippet named 301_redirect

<?php
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: http://www.example.com/$uri");

And I replaced all of the code in my template with this [[!301_redirect? &uri=[[*uri]]]] because for our case it was going to be a direct 1-to-1 redirect to the new subdomain and the uri schema was going to be the exact same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants