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.

CommentFileSizeAuthor
#4 rules_lost_its_operator-2534972-4.patch967 bytesjoelpittet

Comments

jkuma’s picture

Status: Active » Needs work

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

joelpittet’s picture

Status: Needs work » Active

We 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

joelpittet’s picture

Project: Inline Conditions » Commerce Discount

This is a Commerce Discount problem now. There is nothing in inline_conditions that is using that function and it was a private function.

joelpittet’s picture

Status: Active » Needs review
StatusFileSize
new967 bytes

Here's the patch for the missing callback.

joelpittet’s picture

Status: Needs review » Fixed

Thank you for reporting this issue @zmove and @jkuma. I've committed this to -dev.

  • joelpittet committed b81858d on 7.x-1.x
    Issue #2534972 by joelpittet, jkuma, zmove: Rules lost its operator with...

Status: Fixed » Needs work

The last submitted patch, 4: rules_lost_its_operator-2534972-4.patch, failed testing.

joelpittet’s picture

Status: Needs work » Fixed

Testbot! leave it fixed;)

Status: Fixed » Needs review
joelpittet’s picture

Status: Needs review » Fixed

@lukasss it's committed in -dev already so won't apply when re-tested.

zmove’s picture

What about adding a <= and >= operator ? Could be useful in some cases.

joelpittet’s picture

@zmove mind opening a new feature request for that? There is a similar request to that but I think it warrents a new one.

szczesuil’s picture

Hi, 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!

joelpittet’s picture

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

szczesuil’s picture

Hi. 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!

Status: Fixed » Needs work

The last submitted patch, 4: rules_lost_its_operator-2534972-4.patch, failed testing.

mglaman’s picture

Status: Needs work » Fixed

;) Test bot got fixed, so it's running queued patches.

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs review
joelpittet’s picture

Status: Needs review » Closed (fixed)

@Liliplanet This issue is closed.