Hello!

Just did an drush update to a site using tmgmnt and saw these errors:

Invalid argument supplied for foreach() entity.info.inc:151                           [warning]
Invalid argument supplied for foreach() entity.info.inc:151                           [warning]
PHP Fatal error:  Unsupported operand types in /var/www/vhosts/visitozora.com/httpdocs/sites/all/modules/tmgmt/includes/tmgmt.info.inc on line 79
Drush command terminated abnormally due to an unrecoverable error.                    [error]
Error: Unsupported operand types in
/var/www/vhosts/visitozora.com/httpdocs/sites/all/modules/tmgmt/includes/tmgmt.info.inc,
line 79

These come up for anyone else before?

also, when I run the command

drush dis -y tmgmt

I get:

The following extensions will be disabled: tmgmt, tmgmt_entity, tmgmt_ui, tmgmt_i18n_string, tmgmt_microsoft, tmgmt_mygengo, tmgmt_node, tmgmt_node_ui
Do you really want to continue? (y/n): y
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rdf.module:393                               [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rdf.module:393                               [warning]
Attempt to assign property of non-object entity.module:672                            [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rdf.module:393                               [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Invalid argument supplied for foreach() entity.controller.inc:224                     [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:46                            [warning]
Attempt to assign property of non-object rules.core.inc:50                            [warning]
Attempt to assign property of non-object rules.core.inc:51                            [warning]
Attempt to assign property of non-object rdf.module:393                               [warning]
Attempt to assign property of non-object entity.module:672                            [warning]
PHP Fatal error:  Class 'TMGMTJobUIController' not found in /var/www/vhosts/visitozora.com/httpdocs/sites/all/modules/entity/entity.module on line 994
Drush command terminated abnormally due to an unrecoverable error.                    [error]
Error: Class 'TMGMTJobUIController' not found in
/var/www/vhosts/visitozora.com/httpdocs/sites/all/modules/entity/entity.module, line
994

Comments

doublejosh’s picture

Priority: Normal » Major

Seeing the same kinda junk after installing this module.

Error: Unsupported operand types in /ROOT/sites/all/modules/tmgmt/includes/tmgmt.info.inc, line 79
Drush command terminated abnormally due to an unrecoverable error.

Site was white screened. Serious problem.

Perhaps a PHP version issue? I'm on 5.4.4
Assume this isn't actually an object coming back?

    // Link the job id property to the corresponding job entity.
    $properties['tjid'] = array(
      'description' => t('Corresponding job entity.'),
      'type' => 'tmgmt_job',
    ) + $properties['tjid'];
doublejosh’s picture

Title: Invalid argument for foreach() » PHP Fatal error: Unsupported operand types
doublejosh’s picture

Here's the file blame history...
http://drupalcode.org/project/tmgmt.git/blame/refs/heads/7.x-1.x:/includ...

The state of that line before the "major cleanup" commit...
http://drupalcode.org/project/tmgmt.git/blob/435d9e3b7229591bec421204989...

Oddly I couldn't find any references about a change to PHP 5.4 and array operators.

berdir’s picture

That sometimes happens when the cache is messed up. Just add a return; before that line and it should allow you to get past it. Then remove it and try to clear cache again. Not yet sure whats' the root cause.

doublejosh’s picture

Believe I've confirmed that this whole array self-adding duplication silliness is not necessary and actually has no effect other than the error.
Same things exists on lines 111 and 117 as well.

Validated that removing all of these works just fine.

Patch forthcoming.

doublejosh’s picture

May have spoken too soon.
This might cause the job to get stuck translating whatever items you last translated.

doublejosh’s picture

Priority: Major » Normal

I was able to revert this change and with a cleared cache the problem was gone.
Don't understand how a syntax problem could relate to cache status.

I ran gettype() on these items to ensure they weren't objects.

Still a little baffled, but it's not a problem now.

doublejosh’s picture

Once reverted this still happens EVERY TIME we fresh the DB from production... so everyday :)

berdir’s picture

Is your production server using memcache/redis or something like the for the cache and you copy down the old data from the cache tables?

Something like this could happen if the schema data for the tmgmt tables isn't found.

doublejosh’s picture

BINGO!
Very likely the culprit. Will confirm.

doublejosh’s picture

Status: Active » Closed (works as designed)

Fixed by truncating the cache_tmgmt and cache tables.
Might suggest to the memcache module that it add a "Clear DB cache tables" utility.