When I add a new product-line-item-type, I receive the following message:
Notice: Undefined variable: skip_reset en commerce_custom_product_line_item_type_save() (línea 158 de C:\xampp\htdocs\sites\all\modules\commerce_custom_product\commerce_custom_product.module).

Comments

Sean-Khan’s picture

Same issue here.

keesee’s picture

confirmed.

lastar84’s picture

Same here

alexylem’s picture

I have the same issue

fdefeyter@gmail.com’s picture

Me as well... :-)))

office@w3k.at’s picture

File: 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) {

joachim’s picture

Title: Undefined variable » Undefined variable: skip_reset en commerce_custom_product_line_item_type_save

The fix should rather be that $skip_reset should be changed to $skip_rebuild.

office@w3k.at’s picture

i 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....

malberts’s picture

Title: Undefined variable: skip_reset en commerce_custom_product_line_item_type_save » Undefined variable: skip_reset in commerce_custom_product_line_item_type_save
Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.62 KB

A 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.

joachim’s picture

+++ b/commerce_custom_product.module
@@ -128,7 +128,7 @@ function commerce_custom_product_line_item_types() {
+ * @param $skip_reset
  *   Boolean indicating whether or not this save should result in the menu being
  *   rebuilt; defaults to FALSE. This is useful when you intend to perform many

$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.

sierkje’s picture

The 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.

joshmiller’s picture

Status: Needs review » Reviewed & tested by the community

Applied 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

yktdan’s picture

2 months since any action on a reviewed and tested fix

yktdan’s picture

2 months since any action on a reviewed and tested fix

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

I 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...

yktdan’s picture

Verified 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).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

joshuabud’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2
Component: User interface » Code

I'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.

Notice: Undefined variable: skip_reset in commerce_custom_product_line_item_type_save() (line 158 of /Users/WebDev/Sites/wc/sites/all/modules/commerce_custom_product/commerce_custom_product.module).

odisei’s picture

Also 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).

slivorezka’s picture

Also 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 ?

szt’s picture

Issue summary: View changes

Works well wit the latest dev (2013-Sep-30).

jsfry’s picture

Hi 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

benjarlett’s picture

I 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?

a.milkovsky’s picture

Status: Closed (fixed) » Reviewed & tested by the community

Problem is still present. Patch works for me.

rszrama’s picture

Status: Reviewed & tested by the community » Closed (fixed)

The patch was committed in #15, no? You sure you aren't experiencing another issue or running an old version of Commerce?

acrazyanimal’s picture

I 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? ;)

Anonymous’s picture

Just to confirm that #9 solved the issue for me (Drupal 7.38, Commerce 7.x-1.11, Customizable Products 7.x-1.0-beta2).

puia’s picture

#9 worked for me as well

a.milkovsky’s picture

Issue is open for the 7.x-1.0-beta2 version. Problem is not solved for this version yet. Do you plan another recommended release?

milena b’s picture

commerce_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).

hkovacs’s picture

#9 patch works for me.

argiepiano’s picture

#9 patch works for me. Apparently this patch has not made it into the 7.x-1.0-beta2 version.

acrazyanimal’s picture

No 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.