spree_backend 4.7.0 → 4.7.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59f19e0ef61d647e5f849d61e2edfd0027d55ac89e1fea4e9990aa7782d973b3
|
4
|
+
data.tar.gz: 1646f1a5a5af36d79a06064eb74e04b2b39837c8415e003175fb9b5186b0cefb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dced348669db9b22b4dc638fcf67cc331d9dd313c1bb7e89a638967bd5809ecc4c5ab65963b5578b855d40fde4c14caec673e7fcde52771bb38822cd19d02bc2
|
7
|
+
data.tar.gz: c22016785bc6b36dae52c31c433ef9f019ee980bca9aaab2212427e74b0e7fda46bfa941ced8545c68b1acfbe45dcf3c1e17589bda46ab3b52393a067585503b
|
data/Gemfile
CHANGED
@@ -10,7 +10,6 @@ module Spree
|
|
10
10
|
before_action :set_product_defaults, only: :new
|
11
11
|
|
12
12
|
create.before :create_before
|
13
|
-
create.before :fix_option_values_params_rails_7_1
|
14
13
|
update.before :update_before
|
15
14
|
update.before :skip_updating_status
|
16
15
|
update.after :update_status
|
@@ -168,27 +167,6 @@ module Spree
|
|
168
167
|
@prototype = Spree::Prototype.find(params[:product][:prototype_id])
|
169
168
|
end
|
170
169
|
|
171
|
-
def fix_option_values_params_rails_7_1
|
172
|
-
raise 'Verify if the patch is still needed' if Rails::VERSION::STRING >= '7.2.0'
|
173
|
-
|
174
|
-
if Rails::VERSION::STRING >= '7.1.0'
|
175
|
-
# This is a rather ugly fix for an issue with Rails 7.1.0 and 7.1.1
|
176
|
-
# As an example, a form field with name = option_values_hash[1][] and value = 5
|
177
|
-
# gets parsed incorrectly and is visible via params as the following structure
|
178
|
-
# { 'option_values_hash[1' => { '][]' => 5 } }
|
179
|
-
# This patch fixes that behavior to ensure compatibility with the existing templates
|
180
|
-
option_values_hash_keys = params[:product].keys.select { |e| e.starts_with?('option_values_hash[') }
|
181
|
-
option_values_hash = {}
|
182
|
-
option_values_hash_keys.each do |key|
|
183
|
-
value = params[:product].delete(key)
|
184
|
-
fixed_key = key.gsub(/option_values_hash\[/, '')
|
185
|
-
option_values_hash[fixed_key] ||= []
|
186
|
-
option_values_hash[fixed_key] << value['][]']
|
187
|
-
end
|
188
|
-
params[:product][:option_values_hash] = option_values_hash if option_values_hash.present?
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
170
|
def update_before
|
193
171
|
# NOTE: we only reset the product properties if we're receiving a post
|
194
172
|
# from the form on that tab
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% ot.option_values.each do |ov| %>
|
14
14
|
<li>
|
15
15
|
<%= label_tag "option_value_#{ov.id}" do %>
|
16
|
-
<%= check_box_tag "product[option_values_hash[#{ot.id}]
|
16
|
+
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
|
17
17
|
<div class="option-value__color" style="--presentation: <%= ov.presentation %>"></div>
|
18
18
|
<% end %>
|
19
19
|
</li>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<ul class="option-type-values">
|
24
24
|
<% ot.option_values.each do |ov| %>
|
25
25
|
<li>
|
26
|
-
<%= check_box_tag "product[option_values_hash[#{ot.id}]
|
26
|
+
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
|
27
27
|
<%= label_tag "option_value_#{ov.id}", ov.presentation %>
|
28
28
|
</li>
|
29
29
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.7.
|
4
|
+
version: 4.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree
|
@@ -2446,9 +2446,9 @@ licenses:
|
|
2446
2446
|
- BSD-3-Clause
|
2447
2447
|
metadata:
|
2448
2448
|
bug_tracker_uri: https://github.com/spree/spree_backend/issues
|
2449
|
-
changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.7.
|
2449
|
+
changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.7.1
|
2450
2450
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
2451
|
-
source_code_uri: https://github.com/spree/spree_backend/tree/v4.7.
|
2451
|
+
source_code_uri: https://github.com/spree/spree_backend/tree/v4.7.1
|
2452
2452
|
post_install_message:
|
2453
2453
|
rdoc_options: []
|
2454
2454
|
require_paths:
|