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

create:comments outputs "Call to undefined method Drupal\comment\Entity\Comment::getTitle()" #3628

Closed
gkpo opened this issue Dec 10, 2017 · 4 comments

Comments

@gkpo
Copy link

gkpo commented Dec 10, 2017

create:comments outputs "Call to undefined method Drupal\comment\Entity\Comment::getTitle()"

How to reproduce

  • Create some nodes
  • Create some users
  • Launch the create:comments command and answer the prompted questions
  • Press enter to execute the command

Setup

  • Drupal version: 8.4.3
  • Console version: 1.3.1
  • Console Launcher version: 1.3.1
@LOBsTerr
Copy link
Member

LOBsTerr commented Jan 9, 2018

A small addition: it happens, when the script faces some issues during the creation of the comment and it throws an exception. For example we can pass invalid node id - 12121212212121212121

@LOBsTerr
Copy link
Member

LOBsTerr commented Jan 9, 2018

PR #3669

  1. The problem of the warning was, that the wrong method getTitle was used. Comment entity have getSubject method. Probably, code was copied from "Create node" command.
  2. I noticed that there is no validation for node id, I have added it.
  3. Also, I improved a little bit the structure of the code.

I have a question, how can I add the translated string for Node id validation?
Should I create a separate PR for drupal-console-en ?

@LOBsTerr
Copy link
Member

@jmolivas The issue can be closed

@jmolivas
Copy link
Member

Closing this one. Feel free to re-open if still happening after updating to the latest version.

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

No branches or pull requests

3 participants