-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Attribute] Fix hardcoded strings in attribute templates #4014
Conversation
Zales0123
commented
Jan 29, 2016
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Fixed tickets | #3984 |
License | MIT |
Doc PR |
@@ -8,7 +8,8 @@ | |||
<div class="modal-body"> | |||
<div class="list-group"> | |||
{% for name, attributeType in attributeTypes %} | |||
<a href="{{ path('sylius_backend_product_attribute_create', { 'type': name }) }}" id="{{ name }}" class="list-group-item"> | |||
{% set route = 'sylius_backend_'~subject~'_create' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I supposer the subject is product
, so shouldn't it be "sylius_backend_'subject'_attribute_create"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, subject
is "product_attribute"... perhaps variable name is not the best choice 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then see :)
@@ -14,9 +14,9 @@ | |||
<div class="form-group"> | |||
{% set id = form.vars.label|replace(' ', '_')|lower %} | |||
<label class="col-lg-2 control-label required" for="{{ id }}">{{ form.vars.label }}</label> | |||
<input type="hidden" name="sylius_product[attributes][{{ count }}][attribute]" id="sylius_product_attributes_{{ count }}_attribute" value="{{ attributeId }}"/> | |||
<input type="hidden" name="sylius_{{ subject }}[attributes][{{ count }}][attribute]" id="sylius_{{ subject }}_attributes_{{ count }}_attribute" value="{{ attributeId }}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [attributes]
aren't actually [values]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was a talk about attributes collection name some time ago, but it has not been fixed yet. Sure it should be, but I think it's not a case of this PR ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, need application name
8a51f09
to
7e2433e
Compare
@@ -8,7 +8,8 @@ | |||
<div class="modal-body"> | |||
<div class="list-group"> | |||
{% for name, attributeType in attributeTypes %} | |||
<a href="{{ path('sylius_backend_product_attribute_create', { 'type': name }) }}" id="{{ name }}" class="list-group-item"> | |||
{% set route = 'sylius_backend_'~subject~'_attribute_create' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if you're application isn't sylius? I think you need to pass application name here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah 😄 good point Peter 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think, I'll follow @pjedrzejewski advice and pass metadata
object into these templates.
@Zales0123 You can pass |
7e2433e
to
7f998a6
Compare
Looks good now 👍 |
[Attribute] Fix hardcoded strings in attribute templates
Thank you Mateusz! 👍 |