{"action":"opened","issue":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3351","repository_url":"https://api.github.com/repos/wp-cli/wp-cli","labels_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3351/labels{/name}","comments_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3351/comments","events_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3351/events","html_url":"https://github.com/wp-cli/wp-cli/issues/3351","id":173438432,"number":3351,"title":"@alias ignored by `user` commands","user":{"login":"marcusatbang","id":964232,"avatar_url":"https://avatars.githubusercontent.com/u/964232?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusatbang","html_url":"https://github.com/marcusatbang","followers_url":"https://api.github.com/users/marcusatbang/followers","following_url":"https://api.github.com/users/marcusatbang/following{/other_user}","gists_url":"https://api.github.com/users/marcusatbang/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusatbang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusatbang/subscriptions","organizations_url":"https://api.github.com/users/marcusatbang/orgs","repos_url":"https://api.github.com/users/marcusatbang/repos","events_url":"https://api.github.com/users/marcusatbang/events{/privacy}","received_events_url":"https://api.github.com/users/marcusatbang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-26T12:06:57Z","updated_at":"2016-08-26T12:06:57Z","closed_at":null,"body":"We have an alias defined in local `wp-cli.yml`:\r\n\r\n```yaml\r\n@xfer:\r\n  dbname: example_xfer\r\n```\r\n\r\nNote that only `dbname` is set; username, password, etc all stay the same as the primary config.\r\n\r\nWe have a script that (among other things) creates an administrator:\r\n\r\n```bash\r\n#!/bin/bash\r\n...\r\nsudo -u www-data wp @xfer user create localdev localdev@bang-on.net\r\nsudo -u www-data wp @xfer user update localdev --role=administrator --user_pass=localdev\r\n```\r\n\r\nThis creates the user in the primary database, not in the database named by `@xfer`.\r\n\r\nWe've confirmed that the alias is correctly used by other commands, such as `wp @xfer search-replace`. Running the commands with `--debug` shows:\r\n\r\n```\r\nsudo -u www-data wp @xfer user create localdev localdev@bang-on.net --debug\r\nDebug (bootstrap): No readable global config found (0.013s)\r\nDebug (bootstrap): Using project config: /data/example/htdocs/wp-cli.yml (0.014s)\r\nDebug (bootstrap): No package autoload found to load. (0.136s)\r\nDebug (bootstrap): ABSPATH defined: /data/example/htdocs/ (0.137s)\r\nDebug (bootstrap): Begin WordPress load (0.139s)\r\nDebug (bootstrap): wp-config.php path: /data/example/htdocs/wp-config.php (0.14s)\r\nDebug (bootstrap): Loaded WordPress (1.382s)\r\nDebug (bootstrap): Running command: user create (1.382s)\r\nSuccess: Created user 16.\r\nPassword: Ft6mu9UhFCiD\r\n```\r\n\r\nThis creates the user in the primary database, not in the `example_xfer` database referred to by the alias. The debug output shows that it's aware of the config file. The root folder hasn't changed.\r\n\r\n`wp user list` also lists the users from the primary database."}}
{"actor":{"display_login":"marcusatbang"}}