I have the block "Facebook-style Status" inserted in a panel page. Upon submitting a status, I receive the following error message:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'rules_input_evaluator_php_apply' was given in /var/www/sites/all/modules/rules/rules/rules.input_evaluators.inc on line 55.
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'rules_input_evaluator_php_apply' was given in /var/www/sites/all/modules/rules/rules/rules.input_evaluators.inc on line 55.

The status updates weren't appearing on my Heartbeat activity log, but then I saw a Trigger rule that needed to be enabled. Once I did that, I received the error above. The status is not logged with Heartbeat.

I started out with the current recommended stable version of Facebook-style Status and Heartbeat modules.

I'm now using the current dev version of Facebook-style Satus, the current recommended version of the Rules module, Heartbeat (current dev version) and still receiving the same error message.

CommentFileSizeAuthor
#3 fbss_rule.txt1.03 KBicecreamyou

Comments

icecreamyou’s picture

Project: Facebook-style Statuses (Microblog) » Heartbeat
Version: 6.x-2.x-dev » 6.x-4.x-dev
Component: Code - Functionality » Code
Status: Active » Postponed (maintainer needs more info)

This is unlikely to be FBSS's fault. The only thing FBSS has to do with this is telling Rules when it should execute the relevant Rule; it has nothing to do with evaluating the rule itself.

I've attached a rule that you can import to demonstrate this for yourself. It just shows a system message when a status is submitted. There should be no problems.

So, moving to the Heartbeat queue. But I don't know how you could possibly expect this issue to be solved if you don't export your rule so a maintainer can try to replicate your problem.

icecreamyou’s picture

icecreamyou’s picture

StatusFileSize
new1.03 KB

Let's try that attachment again.

Stalski’s picture

As IceCreamYou said, really would need the rule you use.
I don't think this is related to fb_status or heartbeat as it is rules that tries to run "rules_input_evaluator_php_apply". As heartbeat only has two actions and none of them involve custom php code, i would try with the rule of IceCreamYou or diff it with yours.
I can certainly provide you default rules you can use as well. They seem to work just fine for me (with dev version as well). So i am leaving this with status "need more info" because I am willing to help if you provide more info on your specific problem.

regards,

Stalski

Stalski’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Feel free to reopen this if it turns out to the a heartbeat issue.

teleted’s picture

Project: Heartbeat » Facebook-style Statuses (Microblog)
Version: 6.x-4.x-dev » 6.x-2.x-dev
Component: Code » Code - API
Status: Closed (fixed) » Active

Sorry I was not clear. I enabled the rule that was supplied by Facebook-Style Status. I did not modify it other than to check the checkbox that said to enable the rule.

Here is an export of the rulesets for Facebook-style Status:

I imported your rule and it displayed "Hello, world."

My site's Facebook-Style Rules Export:

array (
  'rules' => 
  array (
    'facebook_status_rules_update' => 
    array (
      '#type' => 'rule',
      '#set' => 'event_facebook_status_update',
      '#label' => 'Submit Facebook-style Status',
      '#active' => 1,
      '#weight' => '0',
      '#categories' => 
      array (
        0 => 'facebook_status',
      ),
      '#status' => 'altered',
      '#conditions' => 
      array (
      ),
      '#actions' => 
      array (
        0 => 
        array (
          '#weight' => 0,
          '#info' => 
          array (
            'label' => 'Log to watchdog',
            'module' => 'System',
            'eval input' => 
            array (
              0 => 'type',
              1 => 'message',
              2 => 'link',
            ),
          ),
          '#name' => 'rules_action_watchdog',
          '#settings' => 
          array (
            'severity' => '6',
            'type' => 'rules',
            'message' => '<?php echo check_plain($account->name); ?> submitted the status <?php echo $new_status; ?>.',
            'link' => '/user/<?php echo $account->uid; ?>',
            '#eval input' => 
            array (
              'rules_input_evaluator_php' => 
              array (
                'message' => 
                array (
                  0 => 'account',
                  1 => 'new_status',
                ),
                'link' => 
                array (
                  0 => 'account',
                ),
              ),
            ),
          ),
          '#type' => 'action',
        ),
      ),
      '#version' => 6003,
    ),
    'facebook_status_rules_delete' => 
    array (
      '#type' => 'rule',
      '#set' => 'event_facebook_status_delete',
      '#label' => 'Delete Facebook-style Status',
      '#active' => 1,
      '#weight' => '0',
      '#categories' => 
      array (
        0 => 'facebook_status',
      ),
      '#status' => 'default',
      '#conditions' => 
      array (
      ),
      '#actions' => 
      array (
        0 => 
        array (
          '#type' => 'action',
          '#settings' => 
          array (
            'message' => 'Status deleted.',
            'error' => 0,
          ),
          '#name' => 'rules_action_drupal_message',
          '#info' => 
          array (
            'label' => 'Show a configurable message on the site',
            'module' => 'System',
            'eval input' => 
            array (
              0 => 'message',
            ),
          ),
          '#weight' => 0,
        ),
      ),
      '#version' => 6003,
    ),
  ),
)
icecreamyou’s picture

Component: Code - API » Miscellaneous
Category: bug » support
Status: Active » Fixed

Well obviously you have to add an action to log the status message to heartbeat. And your exported rule is not the same as the default, which is probably related to your error.

Delete the watchdog message action and add an action to record a message to heartbeat.

teleted’s picture

Status: Fixed » Closed (fixed)

Yes, I understand more configuration is necessary, but that rule wasn't created by me, and I can repeat the error by reverting the rule and then re-activating it. I don't know why it doesn't match your export since it surely came from your module.

It just seems to me that a default rule as a placeholder should not generate an error message. Maybe "Log to watchdog" should be replaced (since it fails) with displaying a custom message indicating the admin should add an appropriate action. Or no action at all.

But I'll close the issue since you don't think it's a bug. Thanks for the quick response.

icecreamyou’s picture

I can't reproduce the error you're experiencing, and your export is not what's in the module. (The default rules haven't been changed since Beta 4, which was over 11 months ago.) It's also a rule that's unrelated to Heartbeat -- it is supposed to log a message to your Drupal DB Log.

I can try to help you figure out why you're not seeing the same rule that's in the module if you'd like, although without you having changed it (or unless you're using some very weird version of Rules) I really have no idea why that would be.

jamesfk’s picture

Have you tried turning on the PHP input format filter? That did the trick for me :)

scw’s picture

yes, for me too, thx btw...

totocol’s picture

Thanks too!

eidoscom’s picture

that's it!!!

enabling the PHP filter on modules also worked for me and seems to be the solution ;)