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

The helper "table" is not defined.` #77

Closed
hurbanores opened this issue Apr 6, 2016 · 5 comments
Closed

The helper "table" is not defined.` #77

hurbanores opened this issue Apr 6, 2016 · 5 comments

Comments

@hurbanores
Copy link

When I run php artisan cron:run it gives me the next exception

[Symfony\Component\Console\Exception\InvalidArgumentException] The helper "table" is not defined.

I have installed
"symfony/css-selector": "2.8.*|3.0.*", "symfony/dom-crawler": "2.8.*|3.0.*"

Since I need that version of symfony, I made a research and if I comment the lines 51, 52, 53 and 56 in RunCommand.php this exception disappears.

Note: The cron runs perfectly even if this exception shows, but it doesn't show the table that helds the run date, in time, run time, errors and jobs information

@liebig
Copy link
Owner

liebig commented Apr 6, 2016

It seems that the table helper has been deprecated in symfony 2.5 and removed in 3.0 and we have to use the table class instead. Can you remove the lines 51-56 and add the following code?

$table = new \Symfony\Component\Console\Helper\Table($this->getOutput());
$table
    ->setHeaders(array('Run date', 'In time', 'Run time', 'Errors', 'Jobs'))
    ->setRows(array($report['rundate'], $inTime, round($report['runtime'], 4), $report['errors'], count($report['crons'])));
$table->render();

Maybe this helps.

@liebig liebig added the bug label Apr 6, 2016
@hurbanores
Copy link
Author

Thanks, I did what you proposed and it functions perfectly, but there is one little mistake, in the line
->setRows(array($report['rundate'], $inTime, round($report['runtime'], 4), $report['errors'], count($report['crons'])));

I've fixed it doing this change:
->setRows(array(array($report['rundate'], $inTime, round($report['runtime'], 4), $report['errors'], count($report['crons']))));

Thank you a lot.

@liebig
Copy link
Owner

liebig commented Apr 7, 2016

Great, thank you for the correction and the testing. Should I change the Cron code or did you change the Symfony version manually and this error should not happen if you use the default Laravel version?

@hurbanores
Copy link
Author

I have another proyect whitout Symfony installed and Cron its working perfectly, I think you should mention that bug as a note only if the proyect has Symfony > 2.5

@liebig
Copy link
Owner

liebig commented Apr 13, 2016

Alright, thank you for your feedback. I will add a note to the README.

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

2 participants