Hi,
I've been getting the following warning while using the module:
Warning: Illegal string offset 'field' in view_unpublished_query_alter() (line 139 of C:\inetpub\wwwroot\code\drupal\sites\all\modules\view_unpublished\view_unpublished.module).
A patch is attached with a simple logic change that fixes the issue. It changes the if block from:
if (isset($condition['field']) && $condition['field'] === 'n.status') {
// do stuff
}
elseif (is_object($condition['field'])){
// do stuff
}
to
if (isset($condition['field'])){
if ($condition['field'] === 'n.status') {
// do stuff
}
elseif (is_object($condition['field'])){
// do stuff
}
}
Hope that looks OK. The comments could probably use a rejig too!
Tom
Comments
Comment #1
czigor commentedThis warning appears only from PHP 5.4:
"As of PHP 5.4 string offsets have to either be integers or integer-like strings, otherwise a warning will be thrown. Previously an offset like "foo" was silently cast to 0. "
http://www.php.net/manual/en/language.types.string.php
The patch makes sense and also works for me.
Comment #2
duaelfrThis condition has been rewritten in #1192074-69: Respect View_Unpublished permissions on the Content overview page as a part of the solution.