Closed helgatheviking closed 5 months ago
@helgatheviking
however when activating the Simple User Listing plugin's preview, the users are not imported.
Troubleshooting a specific plugin is outside the scope of support here. I am guessing that this plugin is adding a "User 1" for some type of functionality. But I've never used this plugin...
Try installing a new version of the Playground, check your users. Install the plugin, check your users.
If the new user is created after the clean Playground install, it's not an issue with the Playground. That would be something that is happening as a result of the plugin.
Please let me know what you find out! Thank you for reporting this, I'm working on some best practices for troubleshooting and this is helpful to know what workflows Playground users are doing when finding potential bugs.
I'm the author of that plugin so I am 99% confident it's not adding a stray user.
That said, I am trying to generate some users because I need them to display what my plugin does in the playground (a block that displays some users needs users to display)
I had an XMLfile that when imported manually generates users. When imported via the playground does not. That's what made me want to report it here as it's behaving differently in the playground import.
Interesting. Is there a way I can quickly test this a few more times without have to SVN commit changes to the .org repo? Like can you launch a playground from any XML?
Like can you launch a playground from any XML? https://playground.wordpress.net
You can test your import on a fresh Playground instance there.
Did you import manually? I already confirmed that it works when manually imported via the WordPress admin/WordPress importer plugin.
It's not importing users when running from the blueprint.json's importFile
step that is read when setting up as plugin preview in the playground.
So maybe instead I'm asking if you can set up a playground from any specific blueprint.json. at the moment, the only way I know how to test this is to keep making commits to my plugin's.org repo.
@helgatheviking - I searched the wordpress-playground
repo for the function set_current_user
It's only used in a couple of contexts
activatePlugin
stepactivateTheme
stepenableMultisite
stepI'm thinking the deprecation errors you are seeing may be due to running an outdated version of wp-cli
Either way, I'm not seeing an error in this code that is Playground specific Being able to use the WordPress Importer functionality in Playground provides proof of this...
Going to leave this ticket open, but I'm out of ideas for suggestions as to what may be going wrong
The deprecation notices are annoying and we should fix them, but they're just there normally and are unrelated to this issue.
I wonder if this part of the importFile
that sets the author ID of every post to 1 is causing this problem:
An easy fix would be to grab the ID of the first admin, then editor etc. and only use 1
if no other user is available. Let's go with that one.
A more involved but also permanent fix would be to pull in wp-cli
and run the import command instead of providing a custom import implementation. Or, to avoid extra 4MB of downloads, at least copy over the import command from WP CLI. Let's do it in Blueprints v2.
CCing @bgrgicak – the error log says t.reason is undefined
, it sounds like an issue with the reporter that also obscures the actual error message from WordPress.
Oh, the user with ID 1 actually relates to https://github.com/WordPress/wordpress-playground/issues/1161, not this issue.
Thinking about this more, that entire Always use user ID=1 user mapping strategy used by the importFile step might be wrong and causing this and the other issue you've reported.
I just started a new high-priority issue to solve this and, hopefully, all other WXR problems reported so far:
https://github.com/WordPress/wordpress-playground/issues/1183
I have some users in my demo-content.xml for the importFile step to import.
When importing this file manually, the users are imported, however when activating the Simple User Listing plugin's preview, the users are not imported. (NB: By the time anyone reads this I'll probably have been tinkering with my blueprint.json and switched from import to CLI to just get it working)
But here are the errors I was seeing in the console that might be relvant?