Closed (works as designed)
Project:
Commerce Stock
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2012 at 15:56 UTC
Updated:
16 Jun 2012 at 19:52 UTC
I'm getting the follow error on all of the default rules:
Data selector commerce-product:commerce-stock for parameter data is invalid.
Comments
Comment #1
jazzdrive3 commentedI see now. You need to enable the stock for a product type for that error to go away. No errors on the default rules now.
It might be helpful to add a message on the rules related pages that tell an admin this, with a link to the proper configuration page, as I've see other modules do.
Thanks!
Comment #2
guy_schneerson commentedjazzdrive3, thanks if you have any examples (on other modules) would really help,
Comment #3
jazzdrive3 commentedI think the Date module does something similar to remind people to set the timezone for the site. Just a drupal_set_message() somewhere as long as there are no product types that have stock enabled for them.
Comment #4
guy_schneerson commentedjazzdrive3, ok will try and think of something
Comment #5
guy_schneerson commentedThis is an issue but i am no sure about the bast approach:
The problem is that until you enable stock on one of the product bundles the field does not exist and rules complain.
One approach is to add a message to the site status screen or prompt the user in another way to "Enable stock on one or more product types", however ideally it should be possible to have stock disabled for all products.
Any creative ideas/techniques to handle this would be appreciated.
Comment #6
klavs commentedI got this error message, because appearently the module, when enabled in modulelist, is NOT set to being enabled under the configuration setting.
IMHO I see no reason for configuration options on this - when it only contains an "enable this" - which is what one selects by enabling/disabling the module.
oddly enough, the module is not shown to have any active fields in the module list.
Look at how "commerce price table" works - when I have added the field this module provides (price table) to a product type - it shows in the module list, that this module is currently required for drupal commerce to work (and it shows a link to the field list).
Comment #7
guy_schneerson commentedHi klavs, ill have a look at commerce price table, but from what i remember its a different case.
If i am not mistaken the price table module uses the new field it creates in a custom action and not in stander rules.
The stock module uses the stock field in rules conditions, this allows the customisation of the conditions. the side affect is if you haven't enabled stock on any products rules complains.
this is not only on new installs if you disable stock from all bundles the error will come back.
One possible way around this may be adding the fields to all product types on install and using a configuration setting for enabling disabling stock checks by product type. I am not sure if this is a good idea as i like the ability to create the fields only if they are needed and this will go against the idea of product types having their own identity.
Comment #8
guy_schneerson commentedi am hoping to do a complete re write of stock 2 moving all the metadata to the product content type and the checking marshaled by the stock module to an implementing sub module.
but for now its just the way it works