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

BUGFIX: Reactivates foreign key checks after import database. #1422

Conversation

mjosef89
Copy link
Contributor

@mjosef89 mjosef89 commented Oct 14, 2020

1. Why is this change necessary?

Avoid problems e.g. when swaping the default language to german.

2. What does this change do, exactly?

Reactivates foreign key checks after import database in CLI mode.

3. Describe each step to reproduce the issue or behaviour.

Run the following command:

php public/recovery/install/index.php \
        --no-interaction \
        --db-user=dbuser \
        --db-password=dbpassword \
        --db-name="database" \
        --db-host=localhost \
        --db-port=3306 \
        --shop-locale=de-DE \
        --shop-country=DEU \
        --shop-host=host \
        --shop-path="" \
        --shop-name='CLI Installer test' \
        --shop-currency=EUR \
        --shop-email="test@example.com" \
        --admin-username=admin \
        --admin-password=shopware \
        --admin-email=test@example.com \
        --admin-locale=de-DE \
        --admin-firstname=Test \
        --admin-lastname=Test

Before bugfix

In table language the entry "Deutsch" has the correct default id "2fbb5fe2e29a4d70aa5854ce7ce3e20b".
But because foreign key checks were disabled all language.id references are faulty.
For example in country_translation all english entries still reference the "2fbb5fe2e29a4d70aa5854ce7ce3e20b"
language_id that is now german and the german entries refer to a language_id that no longer exists.

After bugfix
All references to language.id are now correctly adjusted.

5. Checklist

  • I have written tests and verified that they fail without my change
  • I have squashed any insignificant commits
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

@CLAassistant
Copy link

CLAassistant commented Oct 14, 2020

CLA assistant check
All committers have signed the CLA.

@bneumann97
Copy link

Hey @mjosef89, thanks for your contribution. Could you please add a changelog file?

@mjosef89 mjosef89 force-pushed the bugfix/reactivate-foreign-key-checks branch from 0d1509b to 7ed1896 Compare October 20, 2020 07:27
@mjosef89
Copy link
Contributor Author

Done.
Although it was not listed here, I have "Recovery" used as a heading because my change refers to this component.

I hope this is still correct.

@shopwareBot shopwareBot added QuickPick hacktoberfest-accepted PR is accepted by us for Hacktoberfest and removed Incomplete labels Oct 23, 2020
@bneumann97 bneumann97 self-assigned this Nov 2, 2020
@bneumann97
Copy link

@mjosef89 fyi, you are only allowed to use the headers that are listed there. The correct one would be 'Core'. I'll change that for you.

@shopwareBot
Copy link

Hello,

thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-11749

Please use this issue to track the state of your pull request.

@bneumann97
Copy link

Hey @mjosef89, thanks for your contribution 💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted hacktoberfest-accepted PR is accepted by us for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants