Closed (fixed)
Project:
Commerce Customizable Products
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2012 at 04:36 UTC
Updated:
8 Dec 2016 at 14:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Sean-Khan commentedSame issue here.
Comment #2
keesee commentedconfirmed.
Comment #3
lastar84 commentedSame here
Comment #4
alexylem commentedI have the same issue
Comment #5
fdefeyter@gmail.com commentedMe as well... :-)))
Comment #6
office@w3k.at commentedFile: commerce_custom_product.module
I think the error is in line 141:
function commerce_custom_product_line_item_type_save($line_item_type, $configure = TRUE, $skip_rebuild = FALSE)should be:
function commerce_custom_product_line_item_type_save($line_item_type, $configure = TRUE, $skip_reset = FALSE)and line 165:
if (!$skip_rebuild) {should then be:
if (!$skip_reset) {Comment #7
joachim commentedThe fix should rather be that $skip_reset should be changed to $skip_rebuild.
Comment #8
office@w3k.at commentedi thought about that, but in other modules (i.e. commerce_tax_ui) - and previous versions of this module, always $skip_reset is used, so i would stick to that....
Comment #9
malberts commentedA small patch following the solution in #6/#8 instead of #7 because $skip_reset is used by other similar functions and commerce_custom_product.api.php.
Comment #10
joachim commented$reset results in a rebuild.
I see what you're saying about how it's consistent. But to my mind those other functions need changing too.
Comment #11
sierkje commentedThe patch in #9 works fine, and doesn't seem to break anything on my end.
I understand Joachim's point, but I think keeping $skip_reset makes sense. As mentioned above $skip_reset is also used in core modules and APIs (Tax and Product). In the Tax and Product APIs the variable is documented as "Boolean indicating whether or not this update will trigger a cache reset and menu rebuild", in the Product UI module as "Boolean indicating whether or not this save should result in product types being reset and the menu being rebuilt". It seems here only the menu is rebuild when $skip_reset is TRUE, but that is a subset of what it does in Tax and Product, so $skip_reset seems fine to me.
Comment #12
joshmillerApplied patch on #9 as well. I believe Ryan's reaction a few weeks ago when he saw this error during a training was something like, "Darn it. I knew I changed the name of that variable."
So let's mark this RTBC and see what he says about the patch that "fixes" it...
Josh
Comment #13
yktdan commented2 months since any action on a reviewed and tested fix
Comment #14
yktdan commented2 months since any action on a reviewed and tested fix
Comment #15
rszrama commentedI did go ahead and just updated the use of the variable to $skip_rebuild. If you notice in the function body, this particular function actually does perform a line item type reset whether this parameter is TRUE or not, while the parameter explicitly governs whether or not the menu should be rebuilt.
I also changed a direct call to menu_rebuild() in commerce_custom_product_line_item_type_delete() to a use of the menu_rebuild_needed variable and added documentation for $skip_rebuild to the .api.php.
Commit: http://drupalcode.org/project/commerce_custom_product.git/commitdiff/30d...
Comment #16
yktdan commentedVerified as fixing problem. Thanks. How about promoting to non-dev version. I don't like running with dev, e.g. it doesn't show up in update list (I have to explicitly upload it).
Comment #18
joshuabud commentedI'm running the latest version of CK and this issue is still present. Is this fix committed to the dev branch or is it a manual patch? Also if a manual patch maybe we should get it committed.
Comment #19
odisei commentedAlso the sam problem with the latest version, after adding new product line item type I get the following error:
Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 158 of ...\sites\all\modules\commerce_custom_product\commerce_custom_product.module).
Comment #20
slivorezkaAlso the sam problem with the 7.x-1.0-beta2 version, after adding new product line item type I get the following error:
Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 162 of /..../sites/all/modules/commerce_custom_product/commerce_custom_product.module).
U.P
So, I try use changes from here http://drupalcode.org/project/commerce_custom_product.git/commitdiff/30d... (see top of topic).
And error message have disappeared. But I don't know, right whether did I ?
Comment #21
szt commentedWorks well wit the latest dev (2013-Sep-30).
Comment #22
jsfry commentedHi all,
Sorry to report that still getting this notice on 20.8.2014 with Commerce Kickstart (commerce_kickstart-7.x-2.17) on drupal 7.31 - recommended release version. It happened when I saved off a new line item which I created. Don't know if it matters but I installed commerce kickstart and then chose no demo store on install but checked off most of the options below it on install. I will apply patch above. Error: Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 158 of ..... commerce_custom_product.module
Comment #23
benjarlett commentedI just got this too running Customizable Products 7.x-1.0-beta2 and drupal 7.34
Is it an error that I need to worry about?
Comment #24
a.milkovskyProblem is still present. Patch works for me.
Comment #25
rszrama commentedThe patch was committed in #15, no? You sure you aren't experiencing another issue or running an old version of Commerce?
Comment #26
acrazyanimal commentedI think the issue is that the latest recommended release of commerce_custom_product does not have that fix. You need the dev version to get the fix.
The last release was in 2012 and there haven't been any commits to this project since #15. I think it can be considered stable at this stage. Perhaps its time to tag it for release? ;)
Comment #27
Anonymous (not verified) commentedJust to confirm that #9 solved the issue for me (Drupal 7.38, Commerce 7.x-1.11, Customizable Products 7.x-1.0-beta2).
Comment #28
puia commented#9 worked for me as well
Comment #29
a.milkovskyIssue is open for the 7.x-1.0-beta2 version. Problem is not solved for this version yet. Do you plan another recommended release?
Comment #30
milena b commentedcommerce_custom_product-7.x-1.0-beta2
Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 158 of C:\xampp\htdocs\SITENAME\sites\all\modules\commerce_custom_product\commerce_custom_product.module).
Comment #31
hkovacs commented#9 patch works for me.
Comment #32
argiepiano commented#9 patch works for me. Apparently this patch has not made it into the 7.x-1.0-beta2 version.
Comment #33
acrazyanimal commentedNo you need to use the dev version folks.
beta2 will never have it since its a release that happened before the fix commit. If another release, say beta-3 or 1.0, is created then they will have it going forward.