This seems to be an issue in the views_handler_field.inc and theme.inc files. I did a backtrace and got the following:

Array
(
    [0] => 60150
)
#0  check_plain(Array ([0] => 60150)) called at [/home/devnets/public_html/sites/all/modules/contrib/views/handlers/views_handler_field.inc:651]
#1  views_handler_field->get_render_tokens(Array ([alter_text] => 1,[text] => Share,[make_link] => 0,[path] => ,[alt] => ,[link_class] => ,[prefix] => ,[suffix] => ,[target] => ,[trim] => 0,[max_length] => ,[word_boundary] => 1,[ellipsis] => 1,[strip_tags] => 0,[html] => 0,[help] => )) called at [/home/devnets/public_html/sites/all/modules/contrib/views/handlers/views_handler_field.inc:501]
#2  views_handler_field->render_text(Array ([alter_text] => 1,[text] => Share,[make_link] => 0,[path] => ,[alt] => ,[link_class] => ,[prefix] => ,[suffix] => ,[target] => ,[trim] => 0,[max_length] => ,[word_boundary] => 1,[ellipsis] => 1,[strip_tags] => 0,[html] => 0,[help] => )) called at [/home/devnets/public_html/sites/all/modules/contrib/views/handlers/views_handler_field.inc:471]
#3  views_handler_field->advanced_render(stdClass Object ([nid] => 60150,[node_data_field_project_rss_field_project_rss_url] => ,[node_data_field_project_rss_field_project_rss_title] => ,[node_data_field_project_rss_field_project_rss_attributes] => ,[node_type] => project,[node_vid] => 67336  ...  called at [/home/devnets/public_html/sites/all/modules/contrib/views/theme/theme.inc:225]
#4  theme_views_view_field(view Object ([db_table] => views_view,[base_table] => node,[args] => Array ([0] => Array ([0] => 60150)),[use_ajax] => ,[result] => Array ([0] => stdClass Object ...

It all starts with the check_plain API call on line 651, which is consistent with this post:
http://drupal.org/node/1048588

Here are some clues I found that were helpful...:
http://drupal.org/node/525036#comment-3362618
http://drupal.org/node/829250#comment-3148784

Is there a way to get around this in the meantime?

This is a view that incorporates semantic views. I am using:
Views 6.x-2.12
Views Bonus Pack 6.x-1.1
Views Bulk Operations (VBO) 6.x-1.10 (awesome module)
Views RSS 6.x-1.0-beta5
Semantic Views 6.x-1.1
Content Construction Kit (CCK) 6.x-2.9

At the moment, it is not a critical error, but it causing other issues in terms of filling up the watchdog table in a way that is slowing down the whole operation as it happens on a very popular page on our site, at every call for each row of a large and complicated view.

I have also attached a custom template that we are using for that page (http://netsquared.org/projectgallery) in case that helps.

Please let me know if there is something I can do in the meantime...

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

The backtrace appears to be failing on this line:

      $tokens['!' . $count] = isset($this->view->args[$count - 1]) ? check_plain($this->view->args[$count - 1]) : '';

That would mean that $view->args contains array data, which would be a bug in whatever is sending non-string data to a view via arguments. Views accepts *only* strings as arguments.

merlinofchaos’s picture

Issue tags: -t(), -check_plain, -l(), -htmlspecialchars

If it helps, the argument in question appears to be Array ([0] => 60150) -- this may help you determine where this is coming from.

anawillem’s picture

I was afraid this might be the case. We have a custom module that was built for d5 and re-written for d6 that might be the culprit? The (potentially?) relevant snippet is this:

/**
 * Implementation of hook_views_query_alter().
 *
 * For the n2_projects view, intercept the query string and offer
 * custom sort.  The query string argument has a special format, as seen
 * in the sort_type options.
 */
function net2helper_views_query_alter(&$view, &$query) {
  // ross added test_n2_projects to if statement.
  if ($view->name == 'n2_projects' || $view->name == 'test_n2_projects' ||
  $view->name == 'n2_projects_v2') {
    global $_GET;
    //dsm($_GET);
    if (!empty($_GET['sort_type'])) {
      $sort = check_plain($_GET['sort_type']);
      list($sort_label, $sort_order) = str_split($sort, strrpos($sort, '_'));
      $sort_order = substr($sort_order, 1); // Strip off leading underscore
      $query->orderby = array($sort_label .' '. strtoupper($sort_order));
    }
  }
}

...which have to do with radio-button sort options that appear as filters at the top of the view. Could this be creating the issue, or when you say that there is an array being sent as a string, are you talking about something more native to the view itself like the template? I am just trying to troubleshoot, and am not sure if I am understanding your comments below.

Thanks for your very quick response. Your module is so CORE to the drupal platform (hint, hint) and I very much appreciate your responding so quickly.

anawillem’s picture

ps. for that view, there are no explicite arguments defined by the view itself (at least not that are visible through the views UI).

merlinofchaos’s picture

Hm. Yeah, that code doesn't seem to be too likely. Is this view being embedded somewhere via views_embed_view or views_get_view?

anawillem’s picture

In two places, the template calls views_embed_view:

1.

     <?php $cidelement = '<div class="tab-discussion">'; ?>
     <?php if ($id == 'nid_1') : ?>
         <?php print "</div>" .$cidelement;  ?>
         <?php print views_embed_view('project_comments', 'page_1', array($field->content)); ?>
         
     <?php endif; ?>
            <?php endforeach; ?>

2.

            <?php if ($id == 'created' || $id == 'field_project_uri_url_1'
|| $id == 'view_node' || $id == 'tid' || $id == 'field_project_goals_value' || 
$id == 'field_project_expertise_value'): ?>
            <?php if ($id == 'view_node'): ?>
                <?php $created = 0; ?>
                <?php print '<div class="links-block-wrapper">'; ?>
                <?php print views_embed_view('project_comments', 'attachment_2', array($fields['nid_1']->content)); /* Here we embed links box. */ ?>
                <?php print '</div>'; ?>

            <?php endif; ?>

Does this help? I (and hopefully others) am gaining from this discussion. Thanks.

anawillem’s picture

(the code above is from the tpl.php file that i have attached to this ticket, if you would like the see it in it's larger context)

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, those calls to views_embed_view() are the problem. They shouldn't be putting the argument into an array. Just remove the array() from the views_embed_view() calls and your problem should go away.

anawillem’s picture

THANK YOU.

This worked, but I just want to be clear (for n00bs like myself) because there are two ways to translate the above:

  1. <?php print views_embed_view('project_comments', 'attachment_2', $fields['nid_1']->content);
  2. <?php print views_embed_view('project_comments', 'attachment_2');

The FIRST is GOOD.
The second will fail. It will not display the right values.

In any case, merlinofchaos, you have saved my day. I very much appreciate this lesson, as I hope do others. I know that you are busy, and I appreciate your time and your care.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.