I again have received the following error.
Fatal error: Unsupported operand types in /var/www/construction/sites/all/modules/rules/rules/rules.admin_rule_proxy.inc on line 26
The token actions module is not installed. I am updated to the latest releases for both rules and token modules.
My local install works just fine which is running mysql. The server I'm working on is postgresql so I'll be doing a little more testing to compare what exactly is going on. Like i noted in http://drupal.org/node/322242 it appears the data is not being serialized or unserialized correctly. Because when it goes to add that data into the $configurations array in these lines
$configurations[$item_type] = array();
while ($row = db_fetch_object($result)) {
$configurations[$item_type][$row->name] = unserialize($row->data);
}
$row->data does have serialized information.. but after calling unserialize on it I end up with an empty array.
I'll report back here the differences between the mysql and postgresql implementations.
Comments
Comment #1
agn507 commentedI created identical rules in a mysql and postgresql environment.
I added a print_r on around line 1017 of rules.module
so i could evaluate what the data looks like before its being unserialized.
The mysql install contains this
The postgresql install outputted this
The only differences I can see is after the "\015\012" which are where the line breaks are... where i actually hit enter to move to a new line.
It seems the postgresql install is handling it differently possibly causing the unserialize function to fail. I will try and put everything on one line and see if it makes a difference at all.
Comment #2
agn507 commentedThe problem seems to be related to newlines and possibly spaces in the body of the message. I removed all of them so everything was on one line and it worked just fine. Keep in mind this only happens when using postgresql and I believe it has something to do with it converting the newlines to "\015\012"
Comment #3
fagohm, that's strange.
I had a look at the definition of the data field, it's a blob field like the field of the cache table. So if there is such a problem, I wonder if it also occurs in other cases? E.g. the variable cache is also stored in such a value and should also contain e-mail texts (e.g. the user registration mails). I assume you don't have any troubles with this?
Then what if you enter some newlines in another configuration, let's take the php-action. Can you use line-endings there?
Thanks for investigating this, unfortunately I have no test-install with postgresql.
Comment #4
spydmobile commentedconfirmed this behaviour on my pgsql installs
Comment #5
hawk259 commentedHaving same issue with my postgres install.
I manually updated the rule via psql and remove the all the \015\012 and it is working, but of course my email has only one line.
Also rules table looks like this:
while variable looks like this:
The rules data field is bytea, while the variables fields is text. Could this be the problem?
Comment #6
hawk259 commentedHere is a patch that fixes the problem:
Comment #7
fagoah one should decode the blob.. good to know!
thanks, I've committed that.