What we learned during upgrading Pimcore 10.x to 11.x

There is an extensive upgrade guide so we will not repeat that here. The latest version (currently it's 11.0.3) was officially released at the end of June 2023, and we have done our first upgrade of Pimcore from 10.x to 11.x. Here are some notes from the process.

Error: Unable to find file "@PimcoreCoreBundle/config/routing.yml"

Well, devil is in the details. In your app/config/routing.yml you have to change this:

pimcore_core:
    resource: "@PimcoreCoreBundle/Resources/config/routing.yml"

to this:

pimcore_core:
    resource: "@PimcoreCoreBundle/config/routing.yaml"

Actually the most important change is from routing.yml to routing.yaml. Yes, I spent good hour on this. And yes, it's quite explicitly mentioned in official upgrade guide. I hope you will not overlook it as I did.

The button element doesn't exist anymore in Pimcore 11

Sad, we used that on one object type very extensively. See https://github.com/pimcore/pimcore/issues/15124 for more context about this. Now you either have to extend Pimcore backend or use some other solution.

Calculated value has to return string

That's a new one. If you are using calculated value in your data object and calculate this based on expression, you have to return string. In our case we did a really simple calculation returning a number and the type was set to input. Well, we hacked that by adding ~ '' to the end of the expression. That's probably not the best solution but Symfony expression language has no built-in function to convert number to string.

Save function signature has changed

If you override the save function in your data object, you have to change the signature. The old one was:

public function save()

The new one is:

public function save(array $parameters = []): static

Authentication against Pimcore admin

We used this with custom firewall in security.yml, worked fine. Will not anymore as this options completely disappeared. Had to switch to #[IsGranted('ROLE_PIMCORE_USER')] annotation and delete the custom firewall.

Static session access

We used Session::getReadOnly() in our code. This is not possible anymore. Had to switch to other method (for example $request->getSession()->get('key') works).

Ordering by o_id is not possible anymore

Use oo_id instead (or other method).

What else has changed?

Lots of stuff, feel free to read the release notes. Read it slowly and carefully, there are many (breaking) changes. But even after that, you'll hit some showstopper as each project is different. One of the most significant changes is that Pimcore now uses Symfony 6.2. That's a major underlying upgrade, and it brings many changes. To get some more general overview, you can also read this article.

Conclusion & lessons learned

  • upgrade in smallest possible steps
  • take your time and read the release notes
  • follow the upgrade guide
  • test, test, test (and then test again)

You may also like

 16.5.2021
Unit testing Magento 1

Writing unit tests for Magento 1 running in Docker Container

 23.5.2023
An error "Missed phrase" during Magento 2 phrase collection

Exception during phrase collection

 29.3.2022
Debugging Magento CLI running in Docker container

Debugging Magento CLI running in Docker container

 29.12.2022
XSD validation in your IDE

Validate your XML files against Magento 2 XSD schemas

 5.4.2023
Magento release 2.4.6 - what's new

New release of Magento 2

 3.5.2023
Mailhog PHP sendmail path configuration

Sending mails from PHP within Docker with Mailhog

 5.7.2023
Our Pimcore 11 upgrade notes

What we learned during upgrading Pimcore 10.x to 11.x