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

[Variation] Introduce code for option values and replace presentation with name #4237

Merged
merged 1 commit into from
Mar 1, 2016
Merged

Conversation

vikey89
Copy link
Contributor

@vikey89 vikey89 commented Feb 19, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets -
License MIT
Doc PR -

This PR is based from #4213

@pjedrzejewski pjedrzejewski added Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). DX Issues and PRs aimed at improving Developer eXperience. labels Feb 19, 2016
@vikey89 vikey89 changed the title [WIP][Variation] Introduce code for option values and replace presentation with name [Variation] Introduce code for option values and replace presentation with name Feb 23, 2016
@vikey89
Copy link
Contributor Author

vikey89 commented Feb 23, 2016

@pjedrzejewski I think I've finished on this PR.
cc @michalmarcinkowski

@vikey89
Copy link
Contributor Author

vikey89 commented Feb 24, 2016

@pjedrzejewski @michalmarcinkowski I would like to help with something else :)
Any suggestion?

$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE sylius_product_option DROP name');
$this->addSql('DROP INDEX fulltext_search_idx ON sylius_search_index');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and line below seem incorrect.

@pjedrzejewski
Copy link
Member

@vikey89 Great, thank you so much for your time! Could you please squash the commits and have a look at the migration? Otherwise looks good to go!

@@ -105,13 +105,13 @@ public function setValue($value)
/**
* {@inheritdoc}
*/
public function getName()
public function getCodeOption()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be getOptionCode I think, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you're right.

@vikey89
Copy link
Contributor Author

vikey89 commented Feb 24, 2016

@pjedrzejewski I squashed the commits and fixes migration and option code.

@@ -105,13 +105,13 @@ public function setValue($value)
/**
* {@inheritdoc}
*/
public function getName()
public function getOptionCode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 this is much better name.

@okwinza
Copy link
Contributor

okwinza commented Feb 25, 2016

@pjedrzejewski as a sidenote with optionvalues now being translatable we have to be careful when displaying all option values at once otherwise we risk facing something like this(800+ queries FTW)

zomg

In light of this my #4158 quickly becomes quite important to merge IMO.
Or maybe we can introduce some caching mechanism like memcached for doctrine or something.

@nakashu
Copy link
Contributor

nakashu commented Feb 25, 2016

@okwinza is this something that can be handled by setting EAGER loading on the translations and optionValues? It should be then loaded with a single query.

http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#onetomany

@okwinza
Copy link
Contributor

okwinza commented Feb 26, 2016

ping @pjedrzejewski
this seems to be ready to merge. And i also need your thoughts on my comment above.

@vikey89
Copy link
Contributor Author

vikey89 commented Feb 28, 2016

@pjedrzejewski @michalmarcinkowski I would like to collaborate with you more often.
Do you have some issues with more priority? :)

@okwinza
Copy link
Contributor

okwinza commented Feb 28, 2016

@vikey89 you can try to come up with some decent price slider for SearchBundle for example :D

On a serious note it would be nice to have it and #4285 merged already :)
Double ping @pjedrzejewski

pjedrzejewski pushed a commit that referenced this pull request Mar 1, 2016
[Variation] Introduce code for option values and replace presentation with name
@pjedrzejewski pjedrzejewski merged commit 92949a7 into Sylius:master Mar 1, 2016
@pjedrzejewski
Copy link
Member

Thanks Vincenzo! 👍

@psyray
Copy link
Contributor

psyray commented Apr 11, 2016

I think this PR was merged too fast.
Migrations are not correctly done.

What is called migration is not only Create and drop, in some case, like this one, migrations must be Create, select, insert and finally drop like this migration

I am rewriting the migration to copy all values from the option_value table into option_value_translation table because in this state, this PR break my project and certainly other project

@psyray
Copy link
Contributor

psyray commented Apr 11, 2016

Issue & PR created

@pjedrzejewski
Copy link
Member

Hey @psyray, sorry for that. Most migrations are autogenerated right now. We want to fix that soon, as we are minimizing the changes to schema right now. All future migrations will migrate the data as well. Thanks for your contribution!

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
[Variation] Introduce code for option values and replace presentation with name
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
[Variation] Introduce code for option values and replace presentation with name
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
[Variation] Introduce code for option values and replace presentation with name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience. Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants