Fixed #2 by using 24-hour time (no AM/PM) and sticking with yyyy/mm/dd date formatting in the CSV file. Note that there’s no message to the user that date or time conversion failed on import—it just defaults to the current time of the import. I’m guessing it was likely the time formatting in my case since the importer gives data format options, but I haven’t checked explicitly.
Any help for #1 (apostrophes in team names for CSV event import)? I assume that will have to be a code fix, but if there’s a workaround, please let me know. Might have time to skim the code myself—will reply if I find anything obvious.
– Matt
Plugin Author
Brian
(@brianmiyaji)
@lmhaffner Thanks for following up. That’s correct, the importer is a bit picky with the date format.
Regarding team names, I’ll put in a note so that we can improve compatibility, but for now you could add a backslash before the apostrophes. For example, “AJ\’s Black”. Hope that helps 🙂
Brian,
I’ve tried both \’ and ” (two single quotes, another SQL escape option…) but get the same results. Those characters are being escaped properly as team posts are being created with those names, e.g. AJ's Black, AJ\'s Black, or AJ''s Black. But they all fail to match when the next event with that team name is imported.
I delved into the SportPress code for event import, which is very straightforward. I can’t see anything obvious in the SP or WP functions that would caused that match to fail. It doesn’t look like SP modifies the team name before the prepare statement in get_page_by_title. And clearly the team post is being created by SP with the title I’ve passed in after the match fails. I expect it has something to do with how the title is being stored in the db.
I don’t have shell access yet on this server, but I might try to get it and take a look at the table values directly for these titles. Any other suggestions, let me know…
– Matt
Plugin Author
Brian
(@brianmiyaji)
Hi Matt,
Thanks for the additional info and for your feedback. The importers are using single quotes when importing which is most likely the issue, and I might need to add some escaping in the right places to make sure things work properly.
I’ll spend some time this coming week to look into the importer and hopefully find and solve the issue.
I’m having a similar issue. I’m importing a bunch of players. One of the teams has an apostrophe in the name. When I import the players it doesn’t recognize they’re part of that team. It creates a duplicate team for each player I’m importing.
Are there any soccer databases which I could get and import in SportPress? I started to add the players but it takes too much time to do that. I hope it is possible to find it.