
Originally Posted by
Reneetje
After installing 1.5.4 (it is live and working properly) with ez-pages I have only these logfiles left.....and I cannot seem to find the ways how to fix these here on the forum..all help is appreciated!
PHP Warning: trim() expects parameter 1 to be string, array given in D:\www\blabla\www\blabla\admin\ezpages.php on line 140
PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in D:\www\blabla.nl\www\blabla\includes\classes\db\mysql\query_factory.php on line 115
I hope someone is able to offer the solution for one or both of these warnings, it would be great to have no log-files at all, right :)
René
Found to have the same error message (different line number) while trying to verify that this was installed into a ZC 1.5.4 system. Occurred when I was trying to store an EZ-Page that had an html message populated in both of the available language boxes. When I returned to review the status of the ez-page, all of the content was missing because of the error stopping any further data storage. So, this is what I did to resolve it. FYI, system used has PHP 5.3.29.
Where this code was as below:
Code:
if ($zv_link_method_cnt > 1) {
$messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error');
$page_error = true;
}
if ($page_error == false) {
$sql_data_array = array('pages_title' => $pages_title,
'page_open_new_window' => $page_open_new_window,
'page_is_ssl' => $page_is_ssl,
'alt_url' => $alt_url,
'alt_url_external' => $alt_url_external,
'status_header' => $status_header,
'status_sidebox' => $status_sidebox,
'status_footer' => $status_footer,
'status_toc' => $status_toc,
'header_sort_order' => $pages_header_sort_order,
'sidebox_sort_order' => $pages_sidebox_sort_order,
'footer_sort_order' => $pages_footer_sort_order,
'toc_sort_order' => $pages_toc_sort_order,
'toc_chapter' => $toc_chapter,
'pages_html_text' => $pages_html_text);
if ($action == 'insert') {
zen_db_perform(TABLE_EZPAGES, $sql_data_array);
$pages_id = $db->insert_ID();
$languages = zen_get_languages();
$pages_title_array = zen_db_prepare_input($_POST['pages_title']);
It was modified to the below:
Code:
if ($zv_link_method_cnt > 1) {
$messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error');
$page_error = true;
}
if ($page_error == false) {
$sql_data_array = array('pages_title' => $pages_title[$languages[0]['id']],
'page_open_new_window' => $page_open_new_window,
'page_is_ssl' => $page_is_ssl,
'alt_url' => $alt_url,
'alt_url_external' => $alt_url_external,
'status_header' => $status_header,
'status_sidebox' => $status_sidebox,
'status_footer' => $status_footer,
'status_toc' => $status_toc,
'header_sort_order' => $pages_header_sort_order,
'sidebox_sort_order' => $pages_sidebox_sort_order,
'footer_sort_order' => $pages_footer_sort_order,
'toc_sort_order' => $pages_toc_sort_order,
'toc_chapter' => $toc_chapter,
'pages_html_text' => $pages_html_text[$languages[0]['id']]);
if ($action == 'insert') {
zen_db_perform(TABLE_EZPAGES, $sql_data_array);
$pages_id = $db->insert_ID();
$languages = zen_get_languages();
$pages_title_array = zen_db_prepare_input($_POST['pages_title']);
What this does is ensure that TABLE_EXPAGES has the data of the first language box, but doesn't send the two fields as an array and addressed the reported error.