Closed (works as designed)
Project:
Metatag
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2016 at 06:00 UTC
Updated:
18 May 2017 at 20:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
j.b commentedComment #3
csedax90 commentedSame error, but I've Drupal console installed
Comment #4
damienmckennaDarnit :-( Does this help?
Comment #5
damienmckennaOut of interest, what version of Drupal core and PHP are you using?
Comment #6
dan2k3k4 commentedGetting the above error with beta10 but not beta9. And Drupal Core 8.1.x (whatever was latest 8.1 release) with PHP 7.0.0
Comment #7
j.b commentedPatch not working with latest Dev Release.
PHP Fatal error: Trait 'Drupal\\metatag\\Command\\Drupal\\Console\\Command\\Shared\\CommandTrait' not found
Drupal : 8.2.0
PHP: 5.6.23
Comment #8
j.b commentedHi Guys,
I managed to solve this problem.
I had to Install Drupal Console in my Drupal project folder.
Just run this command in your Drupal site folder:
composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader \
--sort-packages
Metatag is now working correctly (i'm using latest dev version)
Comment #9
G42 commentedI get a similar error:
Comment #10
damienmckennaThe problem is that we shouldn't need to install Drupal Console in order for Metatag to work :-\
Comment #11
dawehnerFor now I think the right approach would be to just include the services using a ServiceProvider and checking that console exists.
Note: This patch is purely for myself's composer.json file.
Comment #13
dkre commentedI'm seeing the same error after updating from beta10 - beta11.
The patch (#4) didn't help unfortunately.
PHP: 5.6.21-5+donate.sury.org~trusty+1
Drupal 8.2.2
Comment #14
platinum1 commentedSame problem on 8.3.0-dev and PHP 7.0.12
Running @j.b's solution in #8 resulted in:
Fatal error: Cannot use Symfony\Component\Console\Command\Command as Command because the name is already in use in /home/solution/public_html/my-domain.com/vendor/drupal/console-core/src/Command/CompleteCommand.php on line 12
Comment #15
sachbearbeiter commentedDrupal 8.2.2
PHP 7
Metatag 8.x-1.0-beta11
No Drupal console installed (and i don't want it ;)
Can confirm the problem ...
Comment #16
damienmckennaIs the problem fixed by updating to the latest release of Console?
Comment #17
jeroentI can also confirm the problem.
Drupal 8.2.3
PHP 7
Metatag 8.x-1.0-beta11
No Drupal Console installed.
Comment #18
grm34 commentedSame here,
Drupal 8.2.3
PHP 7.0.13 (Fast-CGI)
Metatag 8.x-1.0-beta11
No Drupal Console installed.
Comment #19
didier misson commentedHello
Does the last Metatag version solve this problem ?
Does the patch #4 solve this problem ?
Near 2 months. But I know it's not a simple problem.
What is the recommande action to unlock ?
Thanks ;-)
Didier
Comment #20
grm34 commentedHi Didier,
No, the dev metatag version does not solve the problem.
No, the patch in #4 does not solve the problem too.
Maybe deactivate metatag until this issue will be solved.
Comment #21
damienmckennaDoes this patch solve the problem? It's an update of dawehner's patch in #11 above.
Comment #22
grm34 commentedThank you DamienMcKenna !
Solved for me with metatag-n2810835-21.patch in #21 with latest metatag dev version.
Comment #23
didier misson commentedThank you Damien
I will test this patch probably tomorrow
Comment #24
damienmckenna"Needs review" is the appropriate issue status when there's a patch being reviewed.
Comment #25
platinum1 commentedThe patch works for me, but I would like to see some additional feedback before changing the status from "Needs review".
Comment #26
mudassar774 commentedNon of the above patch works for me. The issue remains when I try to run any Drupal console command with `metatag-beta11`. I made one patch which works for me.
Comment #27
jmolivas commentedI did download a new drupal vanilla and metatag 8.x-1.0-beta11+6-dev no DrupalConsole downloaded on the site and can not replicate this error.
Comment #28
jmolivas commented@mudassar774 you must be using an old version of DrupalConsole
As a note starting on RC releases DrupalConsole must be installed per site
https://github.com/hechoendrupal/DrupalConsole/#download-as-new-dependency
You can still install the Launcher
https://github.com/hechoendrupal/DrupalConsole/#install-drupal-console-l...
Comment #29
Christopher Riley commentedAfter installing console (although nice, I think it adds even more complexity to a site so please consider not requiring it), when I go to activate the module from the modules page I get the following:
Fatal error: Trait 'Drupal\Console\Command\Shared\CommandTrait' not found in /home/sitename/staging/public_html/modules/metatag/src/Command/GenerateTagCommand.php on line 33
running drupal about I see:
-> drupal about
Drupal Console (1.0.0-rc10)
===========================
Suggestions on what to do besides go back to Drupal 7?
Comment #30
dkre commented#29, I haven't tried the lastest couple of patches but this issue is in the latest release only. Try beta10. I've been using beta10 for a couple of months without issue.
Re: D7 - Metatag doesn't support views atm. If I knew this prior to starting development I would have switched back to D7.
Comment #31
Christopher Riley commentedI am heading back to Drupal 7. It is no wonder that Drupal 8 is taking forever to get implemented on major sites. I guess I will go back to seeing about getting things running with Drupal 8 as soon as Acquia feels that they can update their main site to it.
Thanks for the info.
Comment #32
damienmckennaI'm sorry I haven't gotten to this yet, have been trying to clear other things off my todo list before focusing on Metatag-D8.
Agreed on #26 not being the correct solution with the latest DrupalConsole, the namespace is "Drupal\Console\Command\Shared".
Comment #33
damienmckennaSo here are two questions for anyone having problems:
Comment #34
Christopher Riley commentedMy answer is yes to both to your last set of questions. I will install another dev site on my server so that I can try various things as time permits however I have a couple of projects that I need to get moving on and I can't justify to myself or the customers to go with D8 because there are too many modules that are still "iffy" or "of concern" because they are trying to use Console like this one is.
Comment #35
dkre commentedI don't think this uses Console, it's just a namespace clash (?) which I'm surprised hasn't popped up more.
For the record - D8 is young but it is great in so many ways. While we discovered a few deficits during planning the end result is a pretty solid platform.
Comment #36
damienmckenna@Christopher Riley: We'll have this finished soon, don't let it stop you building sites with D8.
Also, DrupalConsole rc11 is out.
Comment #37
mudassar774 commented@Christopher Riley: Try drupal_console:rc11 and metatag:beta11 both works fine together -:) without any patch
Comment #38
jmolivas commented@mudassar774 Can you try uninstalling Drupal Console from your site
And check if the error appears?
Comment #39
mudassar774 commented@jmolivas I can confirm no error with
drupal:8.2.4
metatag:beta11
drush:8.1.0 (i installed with ui also)
Comment #40
jmolivas commented@mudassar774: Awesome thanks
For me this issue is does not look related to not having DrupalConsole installed on the site.
Looks more related to having an old version of DrupalConsole on the site.
Feel free to ping me if any question related to DrupalConsole or a follow-up on this issue.
Comment #41
Christopher Riley commentedAlright I blew away everything and installed a fresh version of D8 then the latest console then metatag b11 and viola things actually are working. Thanks everyone for the assist now let's hope that everything else goes as smooth.
Comment #42
damienmckennaSo the lesson-learned is - keep up-to-date on Drush and DrupalConsole. I'm sorry that people had problems with this, hopefully things will be better going forwards.
Comment #43
didier misson commentedDamien,
Thanks for all this work about Metatag.
It's a great module for us.
;-)
Didier
Comment #44
spideep commented#28 solve it. Thanks @jmolivas
Comment #45
Chris Gillis commentedUpgrading from 8.x-1.0-beta11 to 8.x-1.0-beta12 fixed it for me.
Comment #46
jagundez commentedI updated drupal/console to "drupal/console": "~1.0" and the metatag module "drupal/metatag": "^1.0", to the stable version but there is an other problem:
Any suggestion?
Thanks!
Comment #47
aronne commentedUsing drupal/console:^0.11.3 the above patches cannot be applied, so I've done this one which seems to work.
Comment #48
kamalMaroc commented@aronne but this version of drupal console 0.11.3 does not working fine with last version of drupal core like 8.3.2
try to run this command in root folder of your projet : drupal list
of course you not get all commande line of drupal console.
So to fixe that try to remove drupal console of your site with this command line composer remove drupal/console and keep drupal console 0.11.3 globaly on your machine.
And it works 100%.