Hi,
I updated inline condition to the latest release and since this update, the rules with operators are broken.
Here is how to reproduce :
- Try to create a new flatrate shipping with drupal commerce
- In the rule condition, try to add a condition depending on the order total amount, or any condition that provide an "operator" field
- You will see on the creation form that the select list with the operators are empty
- Save your condition
- Edit the condition again
- You will see the error message
Here is the error message I have
call_user_func('_inline_conditions_operator_options', Object, 'operator') ui.data.inc:202
RulesDataUIText::inputForm('operator', Array, Array, Object)
call_user_func(Array, 'operator', Array, Array, Object) ui.core.inc:316
RulesPluginUI->getParameterForm('operator', Array, Array, 'input') ui.core.inc:233
RulesPluginUI->form(Array, Array, Array) ui.core.inc:894
RulesAbstractPluginUI->form(Array, Array, Array)
call_user_func_array(Array, Array) faces.inc:130
FacesExtendable->__call('form', Array) rules.core.inc:362
RulesExtendable->__call('form', Array) rules.core.inc:1260
RulesPlugin->form(Array, Array, Array) ui.forms.inc:373
rules_ui_edit_element(Array, Array, Object, Object, 'admin/config/workflow/rules/components')
call_user_func_array('rules_ui_edit_element', Array) form.inc:841
drupal_retrieve_form('rules_ui_edit_element', Array) form.inc:350
drupal_build_form('rules_ui_edit_element', Array) form.inc:130
drupal_get_form('rules_ui_edit_element', Object, Object, 'admin/config/workflow/rules/components')
call_user_func_array('drupal_get_form', Array) menu.inc:519
menu_execute_active_handler() index.php:21
I'm lucky, my website is not in production already, but I think it can be considered as critical as it can break a website entierly if it's heavily based on rules with operators.
Comments
Comment #1
jkuma commentedHello zmove,
Same problem here, the function _inline_conditions_operator_options is missing from inline_conditions. We have to reimplement that function into IC .rules files.
Comment #2
joelpittetWe can look in the repo to try to find it and post a patch.
Status is active
https://www.drupal.org/node/156119#needs-work
Comment #3
joelpittetThis is a Commerce Discount problem now. There is nothing in inline_conditions that is using that function and it was a private function.
Comment #4
joelpittetHere's the patch for the missing callback.
Comment #5
joelpittetThank you for reporting this issue @zmove and @jkuma. I've committed this to -dev.
Comment #8
joelpittetTestbot! leave it fixed;)
Comment #10
joelpittet@lukasss it's committed in -dev already so won't apply when re-tested.
Comment #11
zmove commentedWhat about adding a <= and >= operator ? Could be useful in some cases.
Comment #12
joelpittet@zmove mind opening a new feature request for that? There is a similar request to that but I think it warrents a new one.
Comment #13
szczesuil commentedHi, my shipping flat rates are not being applied to orders.
My current config:
inline-condition alpha5
commerce discount alpha4
I upgraded to alpha5 and added the patch and it works fine.
Thanks so much!
Comment #14
joelpittet@szczesuil have you updated to the latest -dev? I've committed this to dev. Once I get the last 2 remaining tests for usage submodule are fixed, I'll release another beta.
Comment #15
szczesuil commentedHi. I added the patch to alpha5. I didn't want to go to the dev version, cause I wasn't sure what else would be impacted. Thanks for your work!
Comment #17
mglaman;) Test bot got fixed, so it's running queued patches.
Comment #20
joelpittet@Liliplanet This issue is closed.