warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/morphir/www/studier.info/includes/bootstrap.inc on line 588.
this is the view I created:
$view = new stdClass();
$view->name = 'Studiesok';
$view->description = 'studiesok';
$view->access = array (
0 => '1',
1 => '2',
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = '';
$view->page_header = 'Studiesøk';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'node';
$view->url = 'sok';
$view->use_pager = TRUE;
$view->nodes_per_page = '20';
$view->sort = array (
);
$view->argument = array (
array (
'type' => 'taxletter',
'argdefault' => '3',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
);
$view->filter = array (
array (
'tablename' => 'temp_search_results',
'field' => 'word',
'operator' => '=',
'options' => '',
'value' => '',
),
array (
'tablename' => 'term_data',
'field' => 'vid',
'operator' => 'AND',
'options' => '',
'value' => array (
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'search_index',
'field' => 'word',
'label' => 'fastindex',
'optional' => '0',
'is_default' => '1',
'operator' => '0',
'single' => '0',
),
);
$view->requires = array(temp_search_results, term_data, search_index);
$views[$view->name] = $view;
btw. Matt, please contact me over the irc :)
Comments
Comment #1
morphir commenteduhm.. and when I say matt I meant of course doug :D
Anyways, I don't know what causes this error output. But It happened when I turned on taxonomy name filtering. The search form still shows up.
Comment #2
douggreen commentedSomething looks wrong with your view. It should not reference "temp_search_results" in the filter.tablename. I suggest that you remove the filter and exposed filter, and try again, selecting "Search: Fast Index". If this is what you think you did, then please try again, just to make sure.
This filter that appears to work, exported view shown below:
Comment #3
morphir commentedI need to add filters for the search. A vocabulary filter, where you can serch within terms that exist in the vocabulary that gets specified. And it would be preferable to have the vocabularies specified as a drop-down box.
So what I'am asking is, would that be possible to do now? or would I need to create a patch to get this feature?
Comment #4
douggreen commentedSure it can... unless I miss something you are asking for. Anything you can create with views and the standard search filter, you can also create with this filter. I'm closing this issue. If you need help creating the view, please ping me or #drupal-support and someone can walk you through it.
Comment #5
morphir commentedThis worked perfect!
But all filters are presented as drop-down boxes. How could I change the drop-down form to a checkbox form in the view?
Comment #6
dewolfe001 commentedI upgraded to Drupal 5.1. I've seen this on a lot of my admin pages. I went to the source of the errors "bootstrap.inc" and I tinkered with check_plain to see if I could suppress the errors:
That suppressed the errors-- but now when I load the admin/build/block page I get "Array" where before I had blanks. I am going to continue digging in case this is a collision between localization, i8ln and other modules.
Comment #7
douggreen commenteddewolfe001,
This is not the place to propose your core patch. Although, if you want my two cents, that's not the right patch. In general, I believe that Drupal core tries to optimize itself against extra checks like this and relies on the contrib authors to pass the right arguments. If there is a problem, the problem is in the contrib module not in Drupal core.
I suspect (hopt) that your problem is the same as morphirs. Please try recreating your view from scratch. If you still have problems, please export your view and paste it here (within <code> and </code> tags).
Thanks!
Comment #8
dewolfe001 commentedMy problem is coming from almost anywhere on the site that uses check_plain (I say, *almost*, because it's happening everything I can see it, but I feel there must be some good firings on check_plain going on). All of the views and associated modules (eg. Insert Views and Views Theme Wizard, etc.) have been shut off. The problem persists. In debugging this, I trapped any arrays that went through check_plain and did a var_dump of those. All of my problem examples appear when form elements are going through check_plain. I can understands labels, values and form names going through for wrapping each by themselves, but there is something pushing the an entire array into the check_plain function and causing it to choke. The check_plain function is so straightforward, it doesn't have a way to account for arrays, so arrays should never be passed in.
This is all from a Drupal 4.7 => 5.1 upgrade I did, but soon after the install (and well before alot of modules were added or turned on), this problem began to manifest itself and I found it occurring on most of the admin pages.
I dug deeper and looked at a form_element hook I was implementing at the theme level. Its output was a string, but it was triggering check_plain calls and passing in an array:
The call to
t()triggered a call tocheck_plain()if the value of one of the %title or %required were '@', causing this issue to manifest itself.So, short-story-long, I found the bug and that was what it was.
All the best,
Mike
Comment #9
douggreen commentedComment #10
liquidcms commentedsorry but i had to re-open this... i just started trying to use this module and i get the htmlspecialchars error. Found this post but don't see any solution here; so not sure why it is closed.
Also of interest is the fact that i only get the error when i select the OR case, not if i select AND case. I took a look at the 2 different exports and it looks like this is possibly the issue:
OR case
and the AND case:
in the OR case this code looks like the difference:
where there is an empty array for 'value'.. not sure; but looking through rest of this thread i do doubt that the issue is with bootstrap...
oh yea.. and one last thing... O M G.. how great is this module.. you can't imagine the amount of work this has saved me.. :)... well, at least assuming i get this bug sorted out.
Peter Lindstrom
LiquidCMS - Content Management Solution Experts
Comment #11
liquidcms commentedand one more test.. i took the export from OR case above and modified the odd looking bit to be this:
and it seems to save without errors.
Will need to do a few actual search tests to see that it is actually doing the right thing.. but so far this does look like a bug in this module. Will take a loko at the module code if it looks like this solution works.
Comment #12
liquidcms commentedwell i thought it looked fixed.. but when i go to edit the view again.. the error is back (without saving).. but when i look at the export of the newly imported view it has put this code back the way it was.
Comment #13
liquidcms commentedok, i found this post: http://drupal.org/node/142755
which seems like it might be on the right track.. my sql now looks better with the OR, but i see a double DISTINCT that looks wrong.. but then i think i saw another post about that error
Comment #14
liquidcms commentedok, 2 patches later.. and it seems to work.. i still get the htmlspecialchars error when i save a view with the OR case; but the view still seems to be working and searching correctly.
Comment #15
joshk commentedI also get this out of the box w/Druapl 5.1 and Views 1.6, trying to set up a real simple view. I've used this (great!) module before, but this is the first time I've seen this bug.
The view is as follows:
Comment #16
douggreen commentedI can't reproduce this on 5.x-1.1 or on the 5.x-1.x-dev (recently released as 5.x-2.x-dev) versions. Please try with the latest versions of views and VFS. Unless there's a strong compelling reason, I will no longer be supporting the 5.x-1.x branch.
Closing this once again...
Comment #17
Bevan commentedI think this is a views or FAPI issue: http://drupal.org/node/119557
Comment #18
Bevan commentedWoops, wrong link; http://drupal.org/node/179010