Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP Fatal error on sampledata:install routine #3

Closed

Conversation

davidalger
Copy link
Member

The latest push to the magento2 develop branch breaks the sample data. Attempts to install fail due to referencing a now non-existant constant:

PHP Fatal error:  Undefined class constant 'FIELD_NAME_VALIDATION_STRATEGY' in /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup/Product.php on line 84
PHP Stack trace:
PHP   1. {main}() /server/sites/m2.dev/bin/magento:0
PHP   2. Symfony\Component\Console\Application->run() /server/sites/m2.dev/bin/magento:25
PHP   3. Symfony\Component\Console\Application->doRun() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRunCommand() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   5. Symfony\Component\Console\Command\Command->run() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   6. Magento\SampleData\Console\Command\SampleDataInstallCommand->execute() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
PHP   7. Magento\SampleData\Model\SampleData->install() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Console/Command/SampleDataInstallCommand.php:102
PHP   8. Magento\SampleData\Model\Installer->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/SampleData.php:96
PHP   9. Magento\SampleData\Module\ConfigurableProduct\Setup->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/Installer.php:113
PHP  10. Magento\SampleData\Module\ConfigurableProduct\Setup\Product->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup.php:34

Fatal error: Undefined class constant 'FIELD_NAME_VALIDATION_STRATEGY' in /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup/Product.php on line 84

Call Stack:
    0.0002     229368   1. {main}() /server/sites/m2.dev/bin/magento:0
    2.9139   63247472   2. Symfony\Component\Console\Application->run() /server/sites/m2.dev/bin/magento:25
    2.9155   63292104   3. Symfony\Component\Console\Application->doRun() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:126
    2.9157   63293056   4. Symfony\Component\Console\Application->doRunCommand() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:195
    2.9157   63293536   5. Symfony\Component\Console\Command\Command->run() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:874
    2.9159   63297368   6. Magento\SampleData\Console\Command\SampleDataInstallCommand->execute() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
    2.9173   63325144   7. Magento\SampleData\Model\SampleData->install() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Console/Command/SampleDataInstallCommand.php:102
    3.7413   70781968   8. Magento\SampleData\Model\Installer->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/SampleData.php:96
   89.9485  146883664   9. Magento\SampleData\Module\ConfigurableProduct\Setup->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/Installer.php:113
   89.9485  146884088  10. Magento\SampleData\Module\ConfigurableProduct\Setup\Product->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup.php:34

Note: I did not research alternatives to the removed argument. Based on the validation strategy used and the sample data installing with no errors, it may not be necessary any more.

The latest push to the magento2 develop branch breaks the sample data. Attempts to install fail due to referencing a now non-existant constant:

```
PHP Fatal error:  Undefined class constant 'FIELD_NAME_VALIDATION_STRATEGY' in /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup/Product.php on line 84
PHP Stack trace:
PHP   1. {main}() /server/sites/m2.dev/bin/magento:0
PHP   2. Symfony\Component\Console\Application->run() /server/sites/m2.dev/bin/magento:25
PHP   3. Symfony\Component\Console\Application->doRun() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRunCommand() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   5. Symfony\Component\Console\Command\Command->run() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   6. Magento\SampleData\Console\Command\SampleDataInstallCommand->execute() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
PHP   7. Magento\SampleData\Model\SampleData->install() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Console/Command/SampleDataInstallCommand.php:102
PHP   8. Magento\SampleData\Model\Installer->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/SampleData.php:96
PHP   9. Magento\SampleData\Module\ConfigurableProduct\Setup->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/Installer.php:113
PHP  10. Magento\SampleData\Module\ConfigurableProduct\Setup\Product->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup.php:34

Fatal error: Undefined class constant 'FIELD_NAME_VALIDATION_STRATEGY' in /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup/Product.php on line 84

Call Stack:
    0.0002     229368   1. {main}() /server/sites/m2.dev/bin/magento:0
    2.9139   63247472   2. Symfony\Component\Console\Application->run() /server/sites/m2.dev/bin/magento:25
    2.9155   63292104   3. Symfony\Component\Console\Application->doRun() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:126
    2.9157   63293056   4. Symfony\Component\Console\Application->doRunCommand() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:195
    2.9157   63293536   5. Symfony\Component\Console\Command\Command->run() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Application.php:874
    2.9159   63297368   6. Magento\SampleData\Console\Command\SampleDataInstallCommand->execute() /server/sites/m2.dev/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
    2.9173   63325144   7. Magento\SampleData\Model\SampleData->install() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Console/Command/SampleDataInstallCommand.php:102
    3.7413   70781968   8. Magento\SampleData\Model\Installer->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/SampleData.php:96
   89.9485  146883664   9. Magento\SampleData\Module\ConfigurableProduct\Setup->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Model/Installer.php:113
   89.9485  146884088  10. Magento\SampleData\Module\ConfigurableProduct\Setup\Product->run() /server/sites/m2.dev/var/tmp/m2-data/app/code/Magento/SampleData/Module/ConfigurableProduct/Setup.php:34

```
@voleye
Copy link

voleye commented Sep 29, 2015

Hi @davidalger , thank you for this pull request and continued support to Magento 2!

We will try to fix the issue in short terms.

@voleye
Copy link

voleye commented Sep 29, 2015

Internal ticket: MAGETWO-43448

@magento-cicd2
Copy link

We have automated a Magento Contributor License Agreement verifier for contributions sent to our GitHub projects.
Please see the CLA agreement in the Pull Request comments below.

@voleye
Copy link

voleye commented Oct 26, 2015

Fixed

Please, use the following map of "Sample Data" availability:
Stable version available through

Develop version available through

@voleye voleye closed this Oct 26, 2015
@ghost
Copy link

ghost commented Oct 26, 2015

FWIW, in current builds, sampledata:install either doesn't exist or won't work. Please see: http://bit.ly/1M39SUw

@davidalger
Copy link
Member Author

@xcomSteveJohnson There is now a sampledata:deploy command in the develop version of the bin/magento tool. At a glance it appears to do things differently, but didn't have time to play with it to see if it worked completely as it should. :)

@ghost
Copy link

ghost commented Oct 27, 2015

Doubtful because the corresponding sample data packages are not on packages.magento.com.

magento-team pushed a commit that referenced this pull request Nov 1, 2015
[NORD] Sample Data bugfixes
keithbentrup pushed a commit to PMET-public/magento2-sample-data that referenced this pull request Jun 1, 2017
irenelagno pushed a commit that referenced this pull request Jun 28, 2019
MC-17028: Added dependencies to composer files
mmansoor-magento pushed a commit that referenced this pull request Oct 28, 2020
[Arrows] MC-38620: Merge release branch into 2.4-develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants