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

Random user with name 1 is generated #1161

Closed
helgatheviking opened this issue Mar 29, 2024 · 8 comments · Fixed by #1192
Closed

Random user with name 1 is generated #1161

helgatheviking opened this issue Mar 29, 2024 · 8 comments · Fixed by #1192
Assignees

Comments

@helgatheviking
Copy link

I am creating some users via wp cli, and importing a post from XML, but when activating the Simple User Listing plugin's preview, there is a random user with the name "1" that is generated that I can't account for.

image

@flexseth
Copy link
Collaborator

Hey @helgatheviking, can you check the command line wp user list to see if this user is listed there?

Steps to see if the plugin may be the culprit here:

  • Create a new Playground instance
  • Add a user with wp-cli
  • Check the number of users
  • if "1" isn't showing up at that point..
  • install the plugin
  • then use wp user list again to see your users

When did the user show up? I'm guessing with the plugin

@flexseth
Copy link
Collaborator

@helgatheviking if the troubleshooting on the other ticket

Provides more context to this issue, please mark as resolved by closing the ticket 🙌

@helgatheviking
Copy link
Author

I encountered both issues while trying to set up my plugin preview, but I think they are separate issues.

The other ticket is about importing users via XML. This is creating users via CLI. In this instance my blueprint.json has 14ish cli steps that generate a user with some fake names. But there's this one extra user with the user name 1 that I can't account for.... It just appears.

@flexseth
Copy link
Collaborator

@helgatheviking - You'll need to break down your steps to refine where the error is occurring.

Because this isn't a Playground specific issue (IE: a plugin is involved) - it's hard to troubleshoot.

Regarding importing content to WP...
When importing content, if you don't map the content to a user, a new user is created.

This is probably when your user 1 is coming into play. If you do not map content to existing users, it will create a new user for you. This is probably what's happening.

I would recommend creating two blueprints, one without your plugin.

See if user 1 shows up when not using the plugin and mapping the content to an existing user.

@helgatheviking
Copy link
Author

helgatheviking commented Mar 30, 2024

Sounds like first I should see if I can make the imported page get assigned to the default admin user. My plugin isn't creating a user, so it's somewhere in the XML and how the playground/WordPress is dealing with that. I probably won't be and to test that until Monday, but will report back.

The XML assigns the single post to a user that should exist by then.

@flexseth
Copy link
Collaborator

@helgatheviking I'd bet it has to do with the way you are importing the posts to WordPress, this can be a bit tricky.

Try using another development environment like Local, if the same problem persists with the same workflow, it's not Playground specific. Please check when you have time, and if the issue persists, it's not a Playground issue! Have a great weekend!

Best/Seth

@adamziel
Copy link
Collaborator

adamziel commented Apr 2, 2024

Cross-linking a few notes on the possible root cause of this issue:

#1158 (comment)

adamziel added a commit that referenced this issue Apr 3, 2024
…ress-Importer

Rewires the importFile step to:

* Be named importWxz. The old name continues to work, though.
* Use the humanmade/WordPress-Importer for importing content – it is
  more reliable than the official wordpress-importer and has a
  convenient PHP API.
* Drop WXZ support – it's a maintenance burden and doesn't add clear
  value.

Closes #1183
Closes #379
Closes #1158
Closes #1161
@helgatheviking
Copy link
Author

I think y'all fixed this! I just booted up a preview and do not see the "1" user. Thanks!

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