BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Broken Migration in fresh Pimcore 11 Installation #150

Closed sl0wlydeadly closed 3 months ago

sl0wlydeadly commented 4 months ago

Issue: Unable to run the migrations of DataDirector 3.5 on fresh reinstalled (after docker system prune -all) Pimcore 11 project. Following error was thrown:

Error thrown while running command "doctrine:migrations:migrate -n --prefix='Blackbit\DataDirectorBundle'". Message: "Undefined constant "Blackbit\DataDirectorBundle\Migrations\PIMCORE_LOG_FILEOBJECT_DIRECTORY"" {"exception":"[object] (Error(code: 0): Undefined constant \"Blackbit\\DataDirectorBundle\\Migrations\\PIMCORE_LOG_FILEOBJECT_DIRECTORY\" at /var/www/html/vendor/blackbit/data-director/Migrations/Version20220629113618.php:54)","command":"doctrine:migrations:migrate -n --prefix='Blackbit\\DataDirectorBundle'","message":"Undefined constant \"Blackbit\\DataDirectorBundle\\Migrations\\PIMCORE_LOG_FILEOBJECT_DIRECTORY\""} []

Specifically in Migration file: Version20220629113618

Cause for this is that the constant PIMCORE_LOG_FILEOBJECT_DIRECTORY is removed since Pimcore 11. Source: https://github.com/pimcore/pimcore/pull/15175

My suggestion is that it can be safely called like it is done in RestController.php file:

(defined('PIMCORE_LOG_FILEOBJECT_DIRECTORY'))?PIMCORE_LOG_FILEOBJECT_DIRECTORY.'/':''
BlackbitDevs commented 3 months ago

Fixed in 3.5.53.