Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Implement update methods for the drivers #249

Open
johnbillion opened this issue May 31, 2019 · 1 comment
Open

Implement update methods for the drivers #249

johnbillion opened this issue May 31, 2019 · 1 comment

Comments

@johnbillion
Copy link
Contributor

Expected behaviour

The drivers included in Wordhat should include update() methods in their ContentElement classes so that a context can call $this->getDriver()->content->update($args) to update an existing post.

Current behaviour

None of the drivers implement the ContentElement::update() method, so this is not possible.

Context

As a workaround, I tried calling the create() method (via the createContent() method available on the context) and including an ID argument, but this doesn't work with the Wpcli driver. The error is:

Error: Content, title, and excerpt are empty.

WP-CLI doesn't support the --ID argument for wp post create and returns this error for a standalone command such as:

wp post create --ID=123 --post_status=publish

Your environment

  • WordHat version used: 3.1.2
  • Environment name and version: PHP 7.2, Nginx 1.10.3
  • Server operating system type and version: Ubuntu 16.04
  • Type of Behat browser used: Selenium
@paulgibbs
Copy link
Owner

Thanks for creating this report, @johnbillion. On the face of it, it's a pretty big oversight. I'll have to have a think and trawl through git history to see if I had a reason for not including these (I have a suspicion that an earlier version may have removed them), but generally I think this is something that should be re-added soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants