Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have that warning after perform custom pricing rule(drupal commerce) with actions:
-Calculate a value
-Set the unit price to a specific amount
Warning: Illegal string offset 'type' in rules_action_data_calc() (line 78 of [root]/sites/all/modules/rules/modules/data.eval.inc).
I looked at data.eval.inc and there is an array which haven't 'type' key...
Is this a bug or I done something wrong?
Comment | File | Size | Author |
---|---|---|---|
#5 | rules-illegal-offset-1776582-5.patch | 568 bytes | peterpoe |
#3 | rules-illegal-offset-1776582-3.patch | 613 bytes | krlucas |
Comments
Comment #1
raulo CreditAttribution: raulo commentedI had the same problem. I deleted lines 78, 79 and 80
if ($var_info['type'] == 'interger') {
$result = (int) $result;
}
and the problem goes away
Comment #2
a.ross CreditAttribution: a.ross commentedThis problem suddenly came up on a test site I didn't touch for a few weeks. I did, however, upgrade Ubuntu to 12.10. Haven't seen it before the upgrade, so that might have something to do with it.
PHP version right now is 5.4.6, in Ubuntu 12.04 it's currently 5.3.10
Comment #3
krlucas CreditAttribution: krlucas commentedI encountered this same issue with PHP 5.4. Here's a patch.
Comment #5
peterpoe CreditAttribution: peterpoe commented$var_info is never an array, since rules_array_key() extracts an array key.
(Hopefully) proper patch attached.
Comment #6
smokrisReviewed @peterpoe's patch in #5 — it resolves Rules's misuse of
rules_array_key()
, and passes my tests. RTBC.Comment #7
zterry95 CreditAttribution: zterry95 commented#3: rules-illegal-offset-1776582-3.patch queued for re-testing.
Comment #8
zterry95 CreditAttribution: zterry95 commentedreport the same problem. and hope fix this with the patch.
Comment #9
fagoGood catch - thanks committed.
Comment #10.0
(not verified) CreditAttribution: commentedcorrecting typos...
Comment #11
Yusadolat CreditAttribution: Yusadolat commentedmine was reporting Warning: Illegal string offset 'calc' in views_calc_fields_form_validate() (line 323 of C:\xampp\htdocs\edawah\sites\all\modules\views_calc\views_calc.module).