Active
Project:
Rules
Version:
7.x-2.6
Component:
Rules Core
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2013 at 14:49 UTC
Updated:
1 Dec 2016 at 20:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sportel commentedCould someone confirm that something between 2.3 and 2.6 has changed that causes this error?
Comment #2
sportel commentedComment #3
sportel commentedI've installed a fresh Commerce Kickstart 1, which comes with Rules 7.x-2.3. My rules work fine. Then updated to Rules 7.x-2.4, and then I get the error already. So, the bug was introduced in 7.x-2.4. I'll try to investigate further, but haven't got the skills to find errors in the code I'm afraid.
I hope someone can help?
Comment #4
benjifisherI am getting the same error message, and I think I have found a way to fix it. This is obviously a kluge, but it works for me and I tried many different variants, none of which worked. If you have an entity reference parent -> child, then to find the parent from the child, add the following actions to your rule:
I hope it works for you.
Comment #5
sportel commentedHi benjifisher,
Thanks for your response. Do you have the same use case as I have? I'm not quite sure how to fit in your adjustments to my existing rules components. Could you provide an export of your rule?
Thanks,
Mike.
Comment #6
Ravenight commentedI found the patch that broke this.
I went back and installed 7.x-2.3 and patched the files to make rules 7.x-2.4 manually one by one testing to see where the issue started.
This is the patch: https://drupal.org/node/2058037
Before this is applied on 7.x-2.3 you can get the Node by property using the Product Reference field, after you apply the patch you get the error: "The data type of the configured argument does not match the parameter's value requirement." just by saving the already saved rule.
The workaround is to create a variable of type: "List of commerce Product items" and use this as the "The property value of the entity to be fetched." when fetching the node.
Comment #7
sportel commentedNice work Ravenight! I have reported this back at the issue of the suspected patch.
Thanks,
Mike.
Comment #8
sportel commentedComment #9
checker commentedStatus should be active. Needs review is only possible if there is an patch to review.
Comment #10
travist commentedAfter debugging, I discovered that this isn't really an issue. Within the tutorials, it tells you to use the Product-Id, but the issue is that the product ID is type "integer" while the Product reference is of type "commerce_product". The patch that you are referring actually FIXES the problem where instead of showing a type of "commerce_product", it would show a type of "unknown" and as it turns out the Rules type check skips parameters that are of type "unknown".
The FIX here is to actually fix the Rule to instead of refer to the
line-item:commerce-product:product-idto instead only refer to the line-item:commerce-product since that is the same type as the Product reference of "commerce_product".I propose to close this issue since it now works as designed.
Comment #11
checker commentedIn my case this is not possible. I have an entity reference field for product for bundles. This field lives in the commerce_product entity type.
I have a rule that fires on "After updating an existing commerce product".
This rule should show all products that reference to the current updated product. Therefore i'm using "fetch entity by property". So i can fetch easily all products that have current product id stored in their entity reference field. But here i'm not allowed to use commerce-product:product-id or commerce-product of the current updated product (since #2058037: Support all entity properties in the entity query action.)
Current product 1 id
<- referenced by product A (field value is product 1 id)
<- referenced by product B (field value is product 1 id)
Result is a list of product A and product B.
Comment #12
philipz commentedThanks @Ravenight - #6 did the trick!
Comment #13
deggertsen commentedI'm in the same boat as @checker. Did you ever find a solution? I'm tempted to revert the patch in #2058037: Support all entity properties in the entity query action..
Here's my rule, could somebody look at it and figure out if there is a way to fix it? The solution in #10 does not work as line-item:commerce-product (or eventproduct in my case) is not available either.
The summary of my rule:
On {Completing the checkout process}
Do {
Mark registration entities associated with this order as complete
Fetch Registration Entity that references this order
Loop through all found registrations {
Fetch the product that hosts the registration entity by id
Fetch the content entity that references the product id by the product reference field property (This is the broken part)
Run a Rules Set that requires the Completed order , Registration entity, and Content entity
}
}
Comment #14
deggertsen commentedForgot to attach my full rule. Until I hear back on this, I'm going to revert the patch in #2058037: Support all entity properties in the entity query action..
Comment #15
sportel commented@travist,
The error message says something about the data type. The product ID is of type Integer, but "commerce_product" isn't a data type. Do you mean that the Entity Reference field references a String data type? In that case: to what String on the Product entity is the Entity Reference field referencing?
Comment #16
joran lafleuriel commentedHi all
I am not using commerce kiskstart but I a have the same kind of issue :
"Fetch entity by property" doesn't support a dynamic value that would come from a variable set before.
In my case, I want to retreive entities that all refer to another one [ crm core contacts that belongs to a group ]
So... If the "Fetch entity by property" value is filled by a static value ...as a test... it works fine...
But I need this value to change dynamicaly [ from in the context of the node that launch the rule link...]
Setting a rule variable before and put it in the value UI doesn't work. The UI says 'Unknown data type'.
Why "Fetch entity by property" can't accept a simple integer variable that is entity-id ?
Rules 7.x-2.7+6-dev
Drupal version 7.31
Comment #17
deggertsen commentedCRAP! I just realized the file I posted above was bogus. Hate it when you accidentally save the wrong file. Here is the correct one!
Comment #18
fehin commentedI have the same use case as @Sportel. I'm trying to add user to a group after an order. Has anyone gotten this to work?
Comment #19
deggertsen commentedThis is still a problem. Still having to revert patch applied in #2058037: Support all entity properties in the entity query action. in order to fix the problem.
Comment #20
deggertsen commented@travist. I have tried to use "line-item:commerce-product" and it still throws the error "The data type of the configured argument does not match the parameter's value requirement." There is obviously something else going on here.
Comment #21
FranCarstens commentedI'm not sure if my issue is related but it certainly looks like it. When attempting to create a calculation rule my custom variables are not available for "Input Value 2" and any values from the list (randomly added for testing) fail with "The data type of the configured argument does not match the parameter's input_2 requirement".
Comment #22
milena b commentedHi,
I had line items that had Price field. I need to calculate the total price of selected items.(Pizza toppings tutorial on Youtube)
When I displayed line items as radio buttons, I had the same error message when creating a rule.
Then I switched the display to check-boxes I was able to create the rule.
Hope this helps to find the bug.
Comment #23
netw3rker commentedThis may or not be related, but I just ran into a situation where a module I'm using creates multiple data types of a main generic type, and defines an action that could use any one of those specific data types as a parameter.
It turns out our module wasn't defining the "parent" key in hook_rules_data_info(), and as such the action couldn't use the mapping. Here's some pseudo code to describe the problem:
with that, creating a rule that uses the 'example_do_something' action and passing in a parameter of the data type 'ExampleData', the system will throw the referenced error when you attempt to save the action. This is because there's an undocumented "parent" key that is required in this kind of setup. Without it, rules doesn't know that 'ExampleData' is a more specific version of 'ExampleData'.
Simply adding the 'parent' key fixes the problem:
In regards to your problem @deggertsen, My guess is that to fix your problem, you should first check to see if the parent key is being defined for your "line-item:commerce-product" data type. If it's not, you can try adding it in through hook_rules_data_info_alter(). If that fixes it for you, then relay that back to the DrupalCommerce people to fix in their modules.