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

undefined method `ad_hoc_option_values' #16

Open
hkrdrm opened this issue Apr 9, 2019 · 4 comments
Open

undefined method `ad_hoc_option_values' #16

hkrdrm opened this issue Apr 9, 2019 · 4 comments

Comments

@hkrdrm
Copy link

hkrdrm commented Apr 9, 2019

I'm having trouble with this gem. I have it working in my development environment but when I push it to the server I get this error whenever I try to view / edit an order.

[2019-04-09T16:48:39.640103 #5915] FATAL -- : [63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1] ActionView::Template::Error (undefined method `ad_hoc_option_values' for #<Spree::ShippingManifest::ManifestItem:0x0000563a415f1168>):
F, [2019-04-09T16:48:39.640353 #5915] FATAL -- : [63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     1: <div class='customizations'>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     2:   <%# TODO: group multi-select options (e.g. toppings) %>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     3:   <ul class='list-group list-unstyled'>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     4:     <% item.ad_hoc_option_values.each do |ad_hoc_option_value| %>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     5:       <li><b><%= ad_hoc_option_value.option_value.option_type.presentation %>:</b> <%= ad_hoc_option_value.option_value.presentation %></li>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     6:     <% end %>
[63f9bd8d-3d90-4b9b-8b6b-2aaa6bfacec1]     7:     <% item.product_customizations.each do |customization| %>
@dhonig
Copy link
Contributor

dhonig commented Apr 9, 2019

@hkrdrm what environment is your server set to? @acreilly can you take a look?

@hkrdrm
Copy link
Author

hkrdrm commented Apr 9, 2019

its set to production I ran the rake task with RAILS_ENV=production also. It seems like it might have something to do with a particular order or maybe the way the product is setup. I can get the error also in the dev environment now if choose an older item but the new item i setup doesn't cause the error.

It seems to happen soon as click ship. Before I ship the order it seems to load the page fine.

@hkrdrm
Copy link
Author

hkrdrm commented Apr 9, 2019

I think I've narrowed the problem down before you click ship Spree:LineItem is being passed into the _additional_line_item_fields.html.erb partial. But once you click ship it then tries to pass in Spree::ShippingManifest::ManifestItem but its looking for LineItem not ShippingManifest.

I may try to hack it a bit it looks like the ShippingManifest has LineItem as a child.

@hkrdrm
Copy link
Author

hkrdrm commented Apr 9, 2019

<% if item.is_a?(Spree::ShippingManifest::ManifestItem) %>
  <% item = item.line_item %>
<% end %>

Adding these 3 lines to the top of _additional_line_item_fields.html.erb seems to have solved the problem. Not sure if this is a proper fix though.

abhas added a commit to abhas/solidus_flexi_variants that referenced this issue May 4, 2020
Marciobds added a commit to Marciobds/solidus_flexi_variants that referenced this issue Mar 12, 2021
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

No branches or pull requests

2 participants