// composer.json
{
"require": {
"php": "^7.1.3",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"doctrine/doctrine-bundle": "^1.6.10", // 1.10.2
"doctrine/doctrine-migrations-bundle": "^1.3|^2.0", // v2.0.0
"doctrine/orm": "^2.5.11", // v2.7.2
"knplabs/knp-markdown-bundle": "^1.7", // 1.7.0
"knplabs/knp-time-bundle": "^1.8", // 1.8.0
"nexylan/slack-bundle": "^2.0,<2.2.0", // v2.0.0
"php-http/guzzle6-adapter": "^1.1", // v1.1.1
"sensio/framework-extra-bundle": "^5.1", // v5.1.4
"stof/doctrine-extensions-bundle": "^1.3", // v1.3.0
"symfony/asset": "^4.0", // v4.0.4
"symfony/console": "^4.0", // v4.0.14
"symfony/flex": "^1.0", // v1.21.6
"symfony/framework-bundle": "^4.0", // v4.0.14
"symfony/lts": "^4@dev", // dev-master
"symfony/twig-bundle": "^4.0", // v4.0.4
"symfony/web-server-bundle": "^4.0", // v4.0.4
"symfony/yaml": "^4.0" // v4.0.14
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0", // 3.0.2
"easycorp/easy-log-handler": "^1.0.2", // v1.0.4
"fzaninotto/faker": "^1.7", // v1.7.1
"symfony/debug-bundle": "^3.3|^4.0", // v4.0.4
"symfony/dotenv": "^4.0", // v4.0.14
"symfony/maker-bundle": "^1.0", // v1.4.0
"symfony/monolog-bundle": "^3.0", // v3.1.2
"symfony/phpunit-bridge": "^3.3|^4.0", // v4.0.4
"symfony/stopwatch": "^3.3|^4.0", // v4.0.4
"symfony/var-dumper": "^3.3|^4.0", // v4.0.4
"symfony/web-profiler-bundle": "^3.3|^4.0" // v4.0.4
}
}
64 Comments
Hey guys! Was curious if someone could shed some light on the following deprecation warning that I'm seeing in the profiler logs:
A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.It looks like this is/was being dealt with <a href="https://github.com/symfony/maker-bundle/pull/324">here</a> and that a fix was merged in for the <b>symfony/maker-bundle</b>, but the trace shows the warning starting in .../vendor/stof/doctrine-extensions-bundle/DependencyInjection/Configuration.php:17. When it's all said and done, it looks like 10 deprecation messages are logged.
Any idea what might be going on? Anything I can do to fix the deprecations, or will this be fixed in 4.3?
Thanks guys! Loving the well-constructed tutorials!
gedmo/stof extensions are dead since 2017.
This will help: https://github.com/KnpLabs/...
Hey Tomas,
Really sad to hear it! Is it official info? Any links that officially confirm they are abandoned except the fact they are *very* slow on pushing things forward?
And thanks for sharing the link to KnpLabs/DoctrineBehaviors - it's a really good alternative IMO.
Cheers!
Hey,
it's Github info, as you can see yourself. I don't know any mantainers who would be on time to tell people "the package is dead" even if everyone can see it for last 2 years. We miss this honesty in open-source, though it would help lot of project to re-enter legacy.
If you have any troubles with DoctrineBehaviors, just create an issue on Github.
Btw, Rector migration from gedmo/stof to KnpLabs is more than 50 % ready: https://github.com/rectorph...
Hey Tomas,
Thank you for sharing your thoughts about it. And good to know that Rector could help with some migrations if needed!
Cheers!
Doctrine Behaviors 2 is out!
https://www.tomasvotruba.cz...
Hey Tomas,
Yay! Thank you for all your huge job in that bundle! That's GREAT it supports Symfony 5 now :)
Cheers!
The bundle is working well for sluggable and timestampable chapters here, with Symfony 5. I needed to add to config/services.yaml:
For the article class:
Hey Ed,
Thank you for sharing your solution of using KnpLabs/DoctrineBehaviors bundle. I'm not a big fan of random number in slugs, but probably it's the easiest and quickest solution to make slugs unique with this bundle.
Cheers!
Victor, I completely agree on the random number bit. That was a quick hack to get through the tutorial - and it was a good excuse to see if a virtual field works as I was expecting. It does!
Hey Ed,
Ah, sure, then it fits perfect in this case! I did the same if I would need a quick hack to follow the tutorial I think ;)
Cheers!
Cheers :)
The migration path is half-ready: https://github.com/rectorph...
Now it needs testing in user-land.
I'll write about it in next 1-2 weeks
I have the same problems. 20 posts deprecated. "A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0."
Hey Ozornick
Yes, we added a note about that deprecation here: https://symfonycasts.com/sc...
Cheers!
IYes, I tried to search. But the error is in the vendor/ package. Is it undesirable to change it?
`
namespace Stof\DoctrineExtensionsBundle\DependencyInjection;
public function getConfigTreeBuilder()
...
`
Ohh, in that case you can open an issue, or even better send a pull request to the vendor's project :)
BTW, it won't affect you until Symfony 5, so you can just forget about it for awhile
Cheers!
Hey @Christopher
It's caused by outdated
stof/doctrine-extensions-bundle. Where have you got this deprecation message? Is it in our course code? Have you followed course from the start? or playing with finish directory?Cheers!
Thread: https://github.com/symfony/flex/issues/233
I used this thread as a reference, deleted my
vendordirectory, removed the reference from thesymfony.lockfile, and finally rancomposer installfrom command line. Funny enough, thecomposer.lockfile still fails to update to version 1.3 and I still get all the same deprecation warnings.Hey Christopher!
Try running
composer update. The version in your symfony.lock file isn't actually the version you have installed - it's just the version of the "recipe" that was originally used when it was first installed. As you noted, the true version you have installed can be found in composer.lock (or viacomposer show stof/doctrine-extensions-bundle. However, runningcomposer installdoesn't update the composer.lock file - it just reinstalls the version that are listed in that file. To force it to actually download the newest version of a library, usecomposer update.Let us know if this helps!
Cheers!
Hey Ryan!
Thanks for the reply. Yep. I've done all those things as well. I even deleted the
composer.lockfile, made sure that I had the latest version in mycomposer.jsonfile ("stof/doctrine-extensions-bundle": "^1.3"), and then rancomposer installonce again. Still had all the same deprecation warnings plus many more as a result of upgrading to Symfony 4.3.I'm curious if this is playing a part in the whole ordeal - https://github.com/stof/StofDoctrineExtensionsBundle/issues/394. Perhaps we're just dealing with a tag issue?
Thanks so much for any feedback, Ryan!
Ah, indeed! It looks likely that the tag is the issue! Hopefully we can get a tag soon :)
Awesome! Thanks for looking into that for us, Ryan.
Thanks for the reply, Vladimir
The message is seen in the profiler logs. I have been following the tutorials, one after another, but perhaps I've missed something at some point. If it helps, I'm using this in composer.json (which appears to be the latest version on packagist):
<b>"stof/doctrine-extensions-bundle": "^1.3"</b>Then in <b>stof_doctrine_extensions.yaml</b>:
`stof_doctrine_extensions:
Would there be another location that config is necessary?
UPDATE
I just checked my symfony.lock file and for whatever reason, it's using 1.2. I'll try fixing things from that file as well.
Sorry, the stof_doctrine_extensions.yaml config spaces were removed by the browser. They're indented on my end though.
Hi, I have followed exactly same steps, but somehow sluggable is not working. Here is commit related to that: https://github.com/napestershine/Symfony-Learning/commit/857acc2ac6d4aea16344dadb89ceaf9fbd821418
I am getting this error:
`In PDOStatement.php line 119:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null
In PDOStatement.php line 117:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null
`
Hey infete!
Hmm. I just tried the latest commit on your repository - and it looks like it's working fine now - no errors when I load the fixtures and the slug is being set correctly. Are you till having problems?
Cheers!
Hi, yes now it works perfectly. Most probably it was a cache issue on windows system. But works great on Linux.
Thanks so much
Hi everybody ;)
I didin't find :
But the issue was solved with https://github.com/doctrine-extensions/DoctrineExtensions
<br />composer require gedmo/doctrine-extensions<br />add in doctorine.yaml.
check your config it's right:
and create file doctrine_extensions.yaml
uncomment the slug in ArtcliFixture
and test your code ;)
Hey NicolasZ,
Yes, the library you're referencing to ( https://github.com/doctrine... ) is actually caused that issue with their major release :) In the screencast, we use the bundle that is kind of wrapper around the library you linked in your comment that provides some nice integrations with that core library. So, basically, you show how to do things low-level without using the bundle. But now StofDoctrineExtensionsBundle supports this major release so it should work well.
Cheers!
composer updated symfony to 4.4.13 , so far i'm unable to install ago bundle and antishov so how can i downgrade to the version of the source code ?
here is the error
Hey Tarek,
The easiest way would be to download the course code and replace your composer.lock with the one from the start/ directory. But you will need to install all the missing packages again. Or you can take the composer.lock from the finish/ directory that already will hold all the necessary dependencies for this course. Let me know if it helps!
Cheers!
Hi Victor,
I have the same issue that Tarek has and sadly the solution proposed here doesn't work.
It has to do with the bundle version I think,
The newest versions aren't compatible with Symfony 4.4.* and the oldest are only compatible with Symfony 2.2 ~ 3.* versions
I still can't find a solution tho..
Found A Solution, you simply need to downgrade the doctrine/common to 2.13 so that it matches the Gedmo required version and the extensions bundle:
composer require doctrine/common:^2.13.3 --update-with-dependencies
and you're OK to go.
Thanks Bilel cheers , and thank u victor for trying to help
Hey Bilel,
Thank you for sharing your solution with others! Yeah, sometimes it's difficult for Composer to find a correct package especially when there were a major version change. Specifying the version explicitly may help.
Cheers!
Hello,
I can't install stof/doctrine-extensions-bundle.
I get the following error message:
Using version ^1.4 for stof/doctrine-extensions-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove doctrine/cache 1.10.2
- Conclusion: don't install doctrine/cache 1.10.2
- doctrine/common 2.2.1 conflicts with doctrine/cache[1.10.2].
- doctrine/common 2.2.2 conflicts with doctrine/cache[1.10.2].
- doctrine/common 2.2.3 conflicts with doctrine/cache[1.10.2].
- doctrine/common 2.3.0 conflicts with doctrine/cache[1.10.2].
- Installation request for doctrine/cache (locked at 1.10.2) -> satisfiable by doctrine/cache[1.10.2].
- Installation request for stof/doctrine-extensions-bundle ^1.4 -> satisfiable by stof/doctrine-extensions-bundle[v1.4.0].
- Conclusion: don't install doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|install doctrine/common 2.2.3|install doctrine/common 2.3.0
- Conclusion: remove doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|install doctrine/common 2.2.3|install doctrine/common 2.3.0
- stof/doctrine-extensions-bundle v1.4.0 requires gedmo/doctrine-extensions ^2.3.4 -> satisfiable by gedmo/doctrine-extensions[v2.3.10, v2.3.11, v2.3.12, v2.3.4, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.1, v2.4.10, v2.4.11, v2.4.12, v2.4.13, v2.4.14, v2.4.15, v2.4.16, v2.4.17, v2.4.18, v2.4.19, v2.4.2, v2.4.20, v2.4.21, v2.4.22, v2.4.23, v2.4.24, v2.4.25, v2.4.26, v2.4.27, v2.4.28, v2.4.29, v2.4.3, v2.4.30, v2.4.31, v2.4.32, v2.4.33, v2.4.34, v2.4.35, v2.4.36, v2.4.37, v2.4.38, v2.4.39, v2.4.4, v2.4.40, v2.4.41, v2.4.42, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9
Can you help me ?
Solution :
Downgrade doctrine/common from 3.0 to 2.7
composer require doctrine/common:^2.7 --update-with-dependenciesSource : https://github.com/stof/StofDoctrineExtensionsBundle/issues/413
Hey Deplaine N.
Does this
doctrine/common:3.0is installed by course code? Or you updated course code? Or it's your own code?Cheers
Hello guys ! having some error when I use "sluggable" in my entity on the slug fields,
I have follow the exact same way to the tutorial but here is the hug error I get
<br /> There is no extension able to load the configuration for "stof_doctrine_extensions" (in "/symfony_project/config/packages/stof_doctrine_extensions.yaml"). Looked for namespace "stof_doctrine_extensions", found <br /> ""framework", "twig", "twig_extra", "sensio_framework_extra", "doctrine", "doctrine_migrations", "security", "web_profiler", <br /> "monolog", "debug", "maker", "webpack_encore", "knp_time"" in /symfony_project/config <br /> /packages/stof_doctrine_extensions.yaml (which is being imported from "/symfony_project/src/Kernel.php"). <br />Hey Mamadou iliassa S.
It seems to me that you forgot to install
StofDoctrineExtensionsBundlebundle. Could you double check it?Cheers!
Seems like `StofDoctrineExtensionsBundle` 1.4.0 supports Symfony 5: https://github.com/stof/Sto...
That's great! Thanks for the heads up Denis Ž.
Not sure about this but one important line which is missing in the Course Script but present in the video is the removal of the line
->setSlug($this->faker->slug)
from the loadData function in the ArticleFixtures.php class. Hope that helps
Hey jpfortuno!
Thanks for catching that! When we only "remove" a line... it's a tough thing to show in the code block... but I think we should at least try by showing the new code but with the line missing. We'll add a code block.
Cheers!
Working on Windows 10 after reloading the doctrine fixtures in the data base when I refresh the home page the php server dies with the following error:
Compile Error: ContainerNB37shz\srcDevDebugProjectContainer::load(): Failed opening required 'C:\Projects\the_spacebar\var\cache\dev\ContainerNB37shz\getConsole_ErrorListenerService.php' (include_path='C:\xampp\php\PEAR')
any help on figuring out what is happening would be appreciated.
Hey Neal O.
It looks like a permissions problem. Try changing the permissions of that folder and try again.
Cheers!
Is it possible to use sluggable without a field it is maped by?
I need a custom slug which is not connected to any field inside the DB.
But after over 1 hour googling and trial&error the best I came up with, is to create a $slugPlaceholder column which holds the string that gets converted into $slug.
But it seems to be "overhead" for my use case, because $slugPlaceholder is not really needed as column.
I've tried to use temporary $slugPlaceholder variable, but the 'fields' annotation of slugable seems to only accept "real" columns?!
Is there any alternative to get rid of $slugPlaceholder and use only $slug?
<b>Current code:</b>
`
...
`
Hey Mike P.!
Hmm, I don't know the answer for sure, but by the information you're giving, I think you've clearly investigated it and found out that this is probably not possible. A quick search didn't turn up any possibilities. Victor from SfCasts mentioned that this might be possible with https://github.com/KnpLabs/... - but I'm not sure.
Overall, though, it seems like if you need to generate the slug value coming completely from an external source... I'd just do it manually. The class that's responsible for transforming the string into a URL-safe string is here: https://github.com/Atlantic... - so you can use that manually to do it. You could *even* do this in a Doctrine listener, if you wanted it to be automatic.
Let me know if this makes sense! It sounds like it might be a situation where what you need is different enough that using a library is making your life *harder* instead of easier.
Cheers!
Could I ask you one more question?
For categories, do you use the Tree component of Stof Doctrine Extensions of do you do it on "your own"?
What do you suggest to implement categories inside a web project? (By example Categories for space bar articles)
"Houston: no signs of life"
Start the conversation!