Issues with Symfony 2.3 Web Debug Toolbar - symfony

I'm in the process of upgrading old project from Symfony 2.1.x to 2.3.38, later I might try upgrading to latest LTS version. But first, I'd like to get it working at least on 2.3.
Here's the first hint, that something is wrong:
Code inspector shows that there are <a> blocks above two first buttons on toolbar, linking to _profile.
And clicking on any of toolbar items, to get inside debugger, ends up in routing error:
[3/3] Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("No route found for "GET /my_project/web/_wdt/bdc9db"") in #WebProfiler/Profiler/layout.html.twig at line 5.
[2/3] NotFoundHttpException: No route found for "GET /my_project/web/_wdt/bdc9db"
[1/3] ResourceNotFoundException
Maybe someone has encountered similar issues during upgrades? Any ideas how to debug this?
UPDATE:
Regarding the icons offset, looks like this was an issue with Symfony 2.3.38. I upgraded to 2.3.39 and icons are rendered correctly.
"No route found" issue still persist. _wdt is among the routes listed with app/route:debug.
UPDATE 2:
Finally found, that issue with "No route found" is related to sonata/cache-bundle package. If I remove it from AppKernel.php - everything works correctly. It also fixed issue I had with missing session data.

Have You checked if Your app_dev.php is following changes made in 2.3LTS?
https://github.com/symfony/symfony-standard/blob/2.2/web/app_dev.php https://github.com/symfony/symfony-standard/blob/2.3/web/app_dev.php
You have also documents about upgrading from previous versions (deprecations etc) called UPGRADE-X.X.md

Related

Handling 404/4xx/5xx errors in Symfony 4

I'm using Symfony 4.4.10 and I do have problem with correct error 4xx/5xx handling to get users to my custom html.
On production, when 500 error occurs, I'm getting this kind of screen:
Which is weird, because I followed this tutorial: https://symfony.com/doc/current/controller/error_pages.html
I have my templates overridden (like here), but still above screen occurs. (adding error500.html.twig file isn't changing anything)
When I'm debuging on dev it's ok, I mean, with this custom "_error" route.
What can be the problem here?
404 errors and sometimes work, sometimes not.
Regarding the documentation and your shared code, you are right.
Have you got clear cache dev and production environment ?
php bin/console cache:clear

"Data is missing" error occasionally appears

DNN 7.4.2
2SXC 8.8.0
I upgraded to 8.8.0 from 5.5.0. The upgrade went successfully. I only had 2 content types and templates. Now I've added many new content types and templates (more than a dozen) and I've started adding them to my pages.
I'm running into a problem where, every once in awhile, when I browse to a page with Content dropped on the page, I see a module error message that says "Data is missing - usually when a site is copied but the content / apps have not been imported yet..." The error appears for each Content module on the page.
The strange thing is that I never actually exported/imported - I created all my content types and templates from scratch. The problem is also intermittent - sometimes I see the problem, other times it looks normal.
I know our site has some caching on it. Could that be the problem?
ok, in this case we'll presume this is closed

Doctrine entity caching?

I have one project which wasn't developed by me. And it has strange behaviour. I added new field to entity, generated setters/getters for this field as usual. After that I updated database schema through doctrine:schema:update, but now I see very strange behaviour - symfony throws error Call to undefined method %my method name%. I checked again, this method really exists.
After that I cleared a cache through rm -rf app/cache/*. The first page loading all works fine. But at second loading I got this error again. So, when I tried to clear cache again, this situation is repeated. When I tried to use get_class_methods($myEntity), it shows new methods after first page loading, but after second - not.
I tried to use commands like doctrine:cache:clear-*, but they are useless.
Anyone can help me with this problem?
Finally problem was solved when I restarted php-fpm. Such a mistery.

2sxc: 404 Error after adding App module on the page. API is missing?

I have a problem when placing an App module(v 8.4.8) on a page. When I placed an App module on a page I got a pop up saying "Had an error talking to the server (status 404). if you are an advanced user you can learn more about what went wrong - discover how on 2sxc.org/help?tag=debug".
This error happens on whatever action I try to do: trying to add and app, refresh page etc.
I checked a communication to the server using Firebug and seems that one of APIs are missing:
~/desktopmodules/2sxc/api/view/Module/GetSelectableApps
Referer: ~/desktopmodules/tosic_sexycontent/dist/dnn/ui.html?sxcver=8.4.8.19191
Did I missed something? Should I make some configuration after SexyContent module install (v 8.4.8)?
I just checked a video by Daniel Mettler where he showed how to install a module and seems that process is simple. Nothing to worry about.
Does anybody has any idea what might went wrong here?
The same actually happens when I install and Content module: Error about missing APIs:
~/desktopmodules/2sxc/api/view/Module/GetSelectableContentTypes
~/desktopmodules/2sxc/api/view/Module/GetSelectableTemplates
Thanks a lot for your time
My best guess is that it's an issue with the dnn domain/path configuration. So basically my guess is that
you have multiple domains, and if this is configured incorrectly, the paths in the js-calls won't fully match the original one
you have sub-portal (with paths like /products/) or something, and this isn't configured correctly in dnn
languages in portal-paths are causing similar issues.
So please compare EXACTLY the full base path and see if that's the issue.

I'm getting fatal error after including SonataMediaBundle's form templates

I've configured SonataMediaBundle, added relation to Media in my Entity. Admin for entity works fine until I add this snippet from docs:
twig:
form:
resources:
# other files
- 'SonataMediaBundle:Form:media_widgets.html.twig'
After that all I get is this error:
FatalErrorException: Compile Error: Cannot inherit previously-inherited or override constant MARKER from interface Doctrine\Common\Persistence\Proxy
What I'm doing wrong? How to make sonata_media_type work with its widget template?
googling for somedays for a similar error I came up with the conclusion that is has nothing to do with your code, but is some kind of strange bug in environment, more likely in APC.
Check this post if you are using amazon server: https://forums.aws.amazon.com/message.jspa?messageID=508800
After I did that upgrade the problem solved. I'm still waiting to see if it comes out again, because it was not a permanet error, and after each apache reload/restart it went away for a while...
Other op-caches may solve the problem without loosing performance.

Resources