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

Export / Import of events does not recognise date & time #650

Closed
1 task done
carstingaxion opened this issue Apr 30, 2024 · 15 comments · Fixed by #655
Closed
1 task done

Export / Import of events does not recognise date & time #650

carstingaxion opened this issue Apr 30, 2024 · 15 comments · Fixed by #655
Assignees
Labels
bug Something isn't working
Milestone

Comments

@carstingaxion
Copy link
Collaborator

carstingaxion commented Apr 30, 2024

Describe the bug

While working on #649 I realised that events exported via the default WordPress export tool are missing all date & time information. Resulting in incomplete events getting imported.

I searched for export|import, on the repo, with no luck.

Is this real, GatherPress has no mechanism in place to allow the use of the default export and import tools?

Even this is not a typical 🐛 bug, I would consider this a missing major piece.

Steps to Reproduce

  1. Make sure to have some event posts published already.
  2. Go to Tools > Export
  3. Select either all or event posts only
  4. Download .xml file
  5. Open and inspect the .xml file
  6. Search for the date & time data forever ….

Screenshots, screen recording, code snippet

Screenshots can be found attached to comments on GatherPress/gatherpress-demo-data#4 (comment)

Environment information

WordPress playground with GatherPress installed and some demo content.

WordPress information

6.5

Code of Conduct

  • I agree to follow this project's Code of Conduct
@carstingaxion carstingaxion added the bug Something isn't working label Apr 30, 2024
@carstingaxion
Copy link
Collaborator Author

I assume, export and import have been working correct in the past. Is that correct @mauteri ?

@carstingaxion
Copy link
Collaborator Author

  1. Export could maybe extended in hacky way at https://github.com/WordPress/wordpress-develop/blob/6.5/src/wp-admin/includes/export.php#L655-L677, using - wxr_export_skip_postmeta where we could echo out some pseudo-post-meta fields, before returning false like the default.

    What I need is a post_meta key, that will be reliable and 100%-sure in place for every event post. Does such key exist?

@carstingaxion
Copy link
Collaborator Author

  1. Import will be relatively easy I think, because we can use the wp_import_post_data_processed filter to unset the pseudo-post-meta and save the data into the custom DB table.

@mauteri
Copy link
Contributor

mauteri commented Apr 30, 2024

@carstingaxion this is a known issue and I believe was mentioned by @pbrocks in the past. It wasn't ticketed though, so thanks for adding it. The issue is because GatherPress uses custom tables, so that data needs to be exported/imported too and handled appropriately.

@carstingaxion
Copy link
Collaborator Author

@carstingaxion this is a known issue and I believe was mentioned by @pbrocks in the past. It wasn't ticketed though, so thanks for adding it.

You're welcome, thanks.

The issue is because GatherPress uses custom tables, so that data needs to be exported/imported too and handled appropriately.

Yes, I know and already mentioned that. I didn't wanted to complain about using custom DB tables, but more that I was surprised to see, that such bare-bone defaults are missing from the current implementation.

Not being able to import existing data, means also, that nobody would be able to migrate from an existing event plugin. I surely need to take a look at what is already inside the meetup-importer, but at the moment, I think this whole import-export-thing is a major issue, to address before a 1.0 version.

@carstingaxion
Copy link
Collaborator Author

@mauteri What do you think about my sketched solution in the comments here? Did you understand, what my idea is?

@mauteri
Copy link
Contributor

mauteri commented May 1, 2024

@carstingaxion let's review your idea in a Zoom call soon. Agreed that this should be in 1.0 release. I currently have it in Ice Box, but we'll move it up and prioritize in one of the alpha releases. Thanks!

@carstingaxion
Copy link
Collaborator Author

Hello @mauteri

Good idea and yes, but let's chat about the working PoC code, which I wrote today.

The realisation of the missing way to import data into GatherPress hit me really hard, so I needed to start working on it.

@carstingaxion
Copy link
Collaborator Author

It works well locally, but .... https://github.com/carstingaxion/gatherpress-export-import

@carstingaxion carstingaxion mentioned this issue May 4, 2024
4 tasks
@carstingaxion
Copy link
Collaborator Author

So I have to come back to my initial impulse and like to ask why the v2 is used here, while it is buggy, not well documented and not backwards compatible?

Because v1 had even more issues. Sadly, there doesn't seem to be a single importer that would solve all the problems. I know folks in Automattic use at least three different implementations, depending on the use-case. What we really need here is a new, reliable WXR importer that would just work, stream-handle the incoming data, correctly parse character entity references, pause, resume on failure etc. @dmsnell's work on the HTML and XML parser will come handy here.

For documentation and to not feed false expectations about the state of the importer, I wanted to keep this answer by @adamziel on

WordPress/wordpress-playground#1358

@MervinHernandez
Copy link
Collaborator

RE 650 🚩 June 15 Review

✅ Read / noted that Carstin is on it

@MervinHernandez
Copy link
Collaborator

✅ Reviewed June 22 = still in Carstin's hands.

@carstingaxion
Copy link
Collaborator Author

Hey @MervinHernandez, I would appreciate if you could test the related PR. The PR is ready to be tested and can be merged afterwards.

@MervinHernandez
Copy link
Collaborator

@carstingaxion @mauteri commented on #655 = ✅ Test Passed

@carstingaxion
Copy link
Collaborator Author

Thanks for your intense testing @MervinHernandez !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants