I am using Aegir to upgrade Commerce Kickstart to a new version. However, it stumbles on:
Drush command terminated abnormally due to an unrecoverable error. Error: Unsupported operand types in /data/disk/o1/static/commerce_kickstart-7.x-2.x-dev/profiles/commerce_kickstart/modules/contrib/message_notify/message_notify.module, line 80
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | 1782034-view-modes-24.patch | 5.12 KB | amitaibu |
| #21 | 1782034-view-modes-21.patch | 5.12 KB | amitaibu |
| #17 | 1782034-17.patch | 515 bytes | kalman.hosszu |
| #17 | interdiff_1782034-15_1782034-17.txt | 572 bytes | kalman.hosszu |
| #15 | 1782034-15.patch | 513 bytes | Anonymous (not verified) |
Comments
Comment #1
amitaibuI'm unclear how you get $entity_info['message']['view modes'] as NULL. Can you debug it?
Comment #2
7wonders commentedI am also getting this error when doing drush rr on an aegir setup. How can I help to debug?
Comment #3
lsolesen commented@Amitaibu I tried to debug the issue, but did not come up with a solution. But since more people are having problems, maybe a check to see if it is an array should be put in?
Comment #4
socialnicheguru commentedThis is what I got:
/testcommons.socialnicheguru.com$ drush rr
call_user_func() expects parameter 1 to be a valid [warning]
callback, first array member is not a valid class name or
object message_notify.module:75
Invalid argument supplied for foreach() [warning]
message_notify.module:77
PHP Fatal error: Unsupported operand types in /message_notify/message_notify.module on line 80
Fatal error: Unsupported operand types in /message_notify/message_notify.module on line 80
Drush command terminated abnormally due to an [error]
unrecoverable error.
Error: Unsupported operand types in
message_notify/message_notify.module,
line 80
drush dis message_notify
call_user_func() expects parameter 1 to be a valid [warning]
callback, first array member is not a valid class name or
object message_notify.module:75
Invalid argument supplied for foreach() [warning]
message_notify.module:77
PHP Fatal error: Unsupported operand types in message_notify/message_notify.module on line 80
Drush command terminated abnormally due to an [error]
unrecoverable error.
Error: Unsupported operand types in
message_notify/message_notify.module,
line 80
since this is needed for drupal_commons, I can't move forward :(
Comment #5
socialnicheguru commentedI was using the nov 4 dev version
Comment #6
socialnicheguru commented$class, $view_modes, and $view_mode are all NULL.
I debugged and got Null values are all of the above:
var_dump($class);
echo "";
var_dump($view_modes);
echo "";
var_dump($view_mode);
echo "";
var_dump($entity_info['message']['view modes']);
echo "";
This looks like the cause. I wonder if ctools function has changed
$class = ctools_plugin_load_class('message_notify', 'notifier', $notifier_name, 'class');
Edit:
Ctools class_exists($return) returns false in ctools/ includes/plugins.inc
Comment #7
socialnicheguru commentedI am still getting this message.
I will try uninstalling, remove anytihng in the db and variable tables (which I hope there isn't) and re-installing
Edit:
tried all of this and it still was an issue.
Comment #8
Chipie commentedI am getting the same error. Did you find a solution?
Comment #9
socialnicheguru commentedno. i had to comment out the problem lines just to get the install to work.
message notify is not working for me right now
Comment #10
niccolox commentedyep, using Aegir BOA 2.04 dev and Commons Beta 1 and had to comment out for site to run, verify etc
Comment #11
socialnicheguru commentedThis occurred once I disabled modules:
drush dis -y acquia_connector and apachesolr
I wonder if it has to do with either of these or just disabling modules in general
Comment #12
blackandcode commentedThe bug with this is some unsupported operand in PHP. I look at code and find out that someone has error in file message?notify.module on line 80
The code on the line is:
$entity_info['message']['view modes'] += $view_modes;
And I change to
$entity_info['message']['view modes'] .= $view_modes;
Now everything is working!
Comment #13
socialnicheguru commentedcan you explain what " .= " means?
Edit:
.= Concatenate Equals $my_str.="hello"; $my_str = $my_str . "hello";
that makes sense. it just is trying to add the value to the string. Does this work for array elements?
ERROR:
I got an error with cron when trying this method:
drush cron
Error: Unsupported operand types in modules/field_ui/field_ui.module line 180
Fatal error: Unsupported operand types in modules/field_ui/field_ui.module on line 180
Comment #14
socialnicheguru commentedI am going to assume that in the original message_notify module they wanted to append $views_mode array onto the end of another array.
I believe that "+=" and ".=" are used for strings and thus won't work for the array elements.
I tried using array_merge and it seems to work
$entity_info['message']['view modes'] = array_merge($entity_info['message']['view modes'],(array)$view_modes);
http://php.net/manual/en/function.array-merge.php
Edit:
OK array_merge does and "+=" are not the same
http://stackoverflow.com/questions/2140090/operator-for-array-in-php
Comment #15
Anonymous (not verified) commentedi have made a patch based on comment #14
please review
Comment #16
kalman.hosszu commentedI think
array_marge()is better solution than concatenate the arrays. The patch didn't influence the functionality because the tests are passed so I modify the status to RTBC.Comment #17
kalman.hosszu commentedCoding standard is fixed. I stay the status because it's a minor change.
Comment #18
amitaibu@kalman.hosszu ,
Are you able to reproduce it on a clean installation? I think that error is just a symptom for a bug in another module -- as the view-modes should be an array.
Comment #19
socialnicheguru commentedother than checking modules one by one, what other suggestions are there.
Comment #20
socialnicheguru commentedOk, so I went back to take a look.
if you enable this with some modules and not others the error in this queue is thrown.
Taking a look at this line:
call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object message_notify.module:75
Invalid argument supplied for foreach() message_notify.module:77
$ctools_plugin_load_class returns NULL when a number of modules are enabled.
A small list includes:
panels_breadcrumb
panels_createnode
contextual
permission_select
it is tripped when $notifier is "email".
Does every module have to enable this ctools_plugin or should there be a check?
I am not familiar enough to know if items dealing with permissions which are not entities should have a ctools_plugin for a message_notify email plugin.
Lines in message_notify.module giving errors:
CTools ctools_plugin_load_class
Comment #21
amitaibuLet's try to move the view-modes into the plugin definition itself.
Comment #22
Chipie commented@lsolesen: My workaround: comment line 80 during aegir operations (verify, migrate, ..) and then enable the line again.
Comment #24
amitaibuOops, corrected variable.
Comment #25
amitaibuBetter title
Comment #26
amitaibuCan anyone confirm this patch is working
Comment #27
amitaibuCommitted.