I created a list Views to specific nodes, but when I select the formatter "Services Raw" in the fields, their value are not displayed when I view the service, just the Preview of the Views interface.
Service Output in browser:
[{"nid":"6","uuid":"bcce3128-fce0-46f8-a5e8-1dff0a66d4e6","titulo":"Sobre o Evento","body":"<p>Phosfluorescently pursue out-of-the-box total linkage without resource-leveling information. Holisticly fashion competitive outsourcing without bleeding-edge customer service. Rapidiously exploit accurate bandwidth through visionary customer service. Globally disseminate equity invested leadership for mission-critical mindshare. Holisticly syndicate unique initiatives for sticky processes.</p>\n\n<p>Interactively target highly efficient communities rather than flexible niches. Appropriately expedite value-added bandwidth whereas 2.0 technology. Holisticly morph cross-media testing procedures via resource sucking services. Monotonectally promote fully tested testing procedures vis-a-vis alternative e-commerce. Interactively unleash bleeding-edge products rather than error-free bandwidth.</p>\n\n<p>Globally redefine world-class partnerships and end-to-end initiatives. Dramatically integrate cross-platform sources whereas strategic ideas. Objectively predominate value-added content before installed base outsourcing. Holisticly negotiate enterprise e-tailers with functional core competencies. Credibly actualize clicks-and-mortar partnerships vis-a-vis multifunctional models.</p>\n\n<p>Globally extend impactful imperatives after team driven outsourcing. Progressively productivate inexpensive paradigms rather than low-risk high-yield products. Authoritatively generate resource sucking \"outside the box\" thinking through scalable functionalities. Uniquely revolutionize orthogonal process improvements rather than exceptional infomediaries. Proactively mesh economically sound ROI before extensive leadership.</p>\n\n<p>Interactively restore high standards in services before effective content. Globally extend an expanded array of schemas rather than clicks-and-mortar partnerships. Dynamically fabricate maintainable leadership through orthogonal niche markets. Quickly re-engineer professional customer service whereas scalable leadership. Competently aggregate dynamic technologies via vertical partnerships.</p>\n","img":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","geo":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}]
Views export code:
$view = new view();
$view->name = 'services_content';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Services - Content';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'mais';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Aplicar';
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Reiniciar';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Ordenar por';
$handler->display->display_options['exposed_form']['options']['sort_asc_label'] = 'Ascendente';
$handler->display->display_options['exposed_form']['options']['sort_desc_label'] = 'Decrescente';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '1';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['hide_empty'] = TRUE;
/* Campo: Conteúdo: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = 'nid';
$handler->display->display_options['fields']['nid']['element_label_colon'] = FALSE;
/* Campo: Conteúdo: Node UUID */
$handler->display->display_options['fields']['uuid']['id'] = 'uuid';
$handler->display->display_options['fields']['uuid']['table'] = 'node';
$handler->display->display_options['fields']['uuid']['field'] = 'uuid';
$handler->display->display_options['fields']['uuid']['label'] = 'uuid';
/* Campo: Conteúdo: Título */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = 'titulo';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['link_to_node'] = FALSE;
/* Campo: Conteúdo: Corpo */
$handler->display->display_options['fields']['field_body']['id'] = 'field_body';
$handler->display->display_options['fields']['field_body']['table'] = 'field_data_field_body';
$handler->display->display_options['fields']['field_body']['field'] = 'field_body';
$handler->display->display_options['fields']['field_body']['label'] = 'body';
$handler->display->display_options['fields']['field_body']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
/* Campo: Campo: Imagem */
$handler->display->display_options['fields']['field_img']['id'] = 'field_img';
$handler->display->display_options['fields']['field_img']['table'] = 'field_data_field_img';
$handler->display->display_options['fields']['field_img']['field'] = 'field_img';
$handler->display->display_options['fields']['field_img']['label'] = 'img';
$handler->display->display_options['fields']['field_img']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_img']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_img']['type'] = 'services';
$handler->display->display_options['fields']['field_img']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
/* Campo: Conteúdo: Geo-posição */
$handler->display->display_options['fields']['field_geo_position']['id'] = 'field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['table'] = 'field_data_field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['field'] = 'field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['label'] = 'geo';
$handler->display->display_options['fields']['field_geo_position']['click_sort_column'] = 'geom';
$handler->display->display_options['fields']['field_geo_position']['type'] = 'services';
$handler->display->display_options['fields']['field_geo_position']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
/* Critério de filtragem: Conteúdo: Publicado */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Critério de filtragem: Conteúdo: Tipo */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'pagina' => 'pagina',
);
/* Critério de filtragem: Conteúdo: Nid */
$handler->display->display_options['filters']['nid']['id'] = 'nid';
$handler->display->display_options['filters']['nid']['table'] = 'node';
$handler->display->display_options['filters']['nid']['field'] = 'nid';
$handler->display->display_options['filters']['nid']['exposed'] = TRUE;
$handler->display->display_options['filters']['nid']['expose']['operator_id'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['label'] = 'Nid';
$handler->display->display_options['filters']['nid']['expose']['operator'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['identifier'] = 'nid';
$handler->display->display_options['filters']['nid']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Display: Páginas */
$handler = $view->new_display('services', 'Páginas', 'content_pagina');
$handler->display->display_options['path'] = 'content_pagina';
/* Display: Noticias */
$handler = $view->new_display('services', 'Noticias', 'content_noticia');
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Campo: Conteúdo: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = 'nid';
/* Campo: Conteúdo: Node UUID */
$handler->display->display_options['fields']['uuid']['id'] = 'uuid';
$handler->display->display_options['fields']['uuid']['table'] = 'node';
$handler->display->display_options['fields']['uuid']['field'] = 'uuid';
$handler->display->display_options['fields']['uuid']['label'] = 'UUID';
/* Campo: Conteúdo: Título */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['link_to_node'] = FALSE;
/* Campo: Conteúdo: Corpo */
$handler->display->display_options['fields']['field_body']['id'] = 'field_body';
$handler->display->display_options['fields']['field_body']['table'] = 'field_data_field_body';
$handler->display->display_options['fields']['field_body']['field'] = 'field_body';
$handler->display->display_options['fields']['field_body']['label'] = 'body';
$handler->display->display_options['fields']['field_body']['type'] = 'services';
$handler->display->display_options['fields']['field_body']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
/* Campo: Campo: Imagem */
$handler->display->display_options['fields']['field_img']['id'] = 'field_img';
$handler->display->display_options['fields']['field_img']['table'] = 'field_data_field_img';
$handler->display->display_options['fields']['field_img']['field'] = 'field_img';
$handler->display->display_options['fields']['field_img']['label'] = 'img';
$handler->display->display_options['fields']['field_img']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_img']['type'] = 'services';
$handler->display->display_options['fields']['field_img']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 1,
);
/* Campo: Conteúdo: Arquivos Anexados */
$handler->display->display_options['fields']['field_anexos']['id'] = 'field_anexos';
$handler->display->display_options['fields']['field_anexos']['table'] = 'field_data_field_anexos';
$handler->display->display_options['fields']['field_anexos']['field'] = 'field_anexos';
$handler->display->display_options['fields']['field_anexos']['label'] = 'anexos';
$handler->display->display_options['fields']['field_anexos']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_anexos']['type'] = 'services';
$handler->display->display_options['fields']['field_anexos']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
$handler->display->display_options['fields']['field_anexos']['delta_offset'] = '0';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Critério de filtragem: Conteúdo: Publicado */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Critério de filtragem: Conteúdo: Tipo */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'noticia' => 'noticia',
);
/* Critério de filtragem: Conteúdo: Nid */
$handler->display->display_options['filters']['nid']['id'] = 'nid';
$handler->display->display_options['filters']['nid']['table'] = 'node';
$handler->display->display_options['filters']['nid']['field'] = 'nid';
$handler->display->display_options['filters']['nid']['exposed'] = TRUE;
$handler->display->display_options['filters']['nid']['expose']['operator_id'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['label'] = 'Nid';
$handler->display->display_options['filters']['nid']['expose']['operator'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['identifier'] = 'nid';
$handler->display->display_options['filters']['nid']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
$handler->display->display_options['path'] = 'content_noticia';
/* Display: Hoteis */
$handler = $view->new_display('services', 'Hoteis', 'content_hotel');
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Campo: Conteúdo: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = 'nid';
/* Campo: Conteúdo: Node UUID */
$handler->display->display_options['fields']['uuid']['id'] = 'uuid';
$handler->display->display_options['fields']['uuid']['table'] = 'node';
$handler->display->display_options['fields']['uuid']['field'] = 'uuid';
$handler->display->display_options['fields']['uuid']['label'] = 'UUID';
/* Campo: Conteúdo: Título */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['link_to_node'] = FALSE;
/* Campo: Conteúdo: Corpo */
$handler->display->display_options['fields']['field_body']['id'] = 'field_body';
$handler->display->display_options['fields']['field_body']['table'] = 'field_data_field_body';
$handler->display->display_options['fields']['field_body']['field'] = 'field_body';
$handler->display->display_options['fields']['field_body']['label'] = 'body';
$handler->display->display_options['fields']['field_body']['type'] = 'services';
$handler->display->display_options['fields']['field_body']['settings'] = array(
'skip_safe' => 1,
'skip_empty_values' => 1,
);
/* Campo: Campo: Imagem */
$handler->display->display_options['fields']['field_img']['id'] = 'field_img';
$handler->display->display_options['fields']['field_img']['table'] = 'field_data_field_img';
$handler->display->display_options['fields']['field_img']['field'] = 'field_img';
$handler->display->display_options['fields']['field_img']['label'] = 'img';
$handler->display->display_options['fields']['field_img']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_img']['type'] = 'services';
$handler->display->display_options['fields']['field_img']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 1,
);
/* Campo: Conteúdo: Geo-posição */
$handler->display->display_options['fields']['field_geo_position']['id'] = 'field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['table'] = 'field_data_field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['field'] = 'field_geo_position';
$handler->display->display_options['fields']['field_geo_position']['label'] = 'geo';
$handler->display->display_options['fields']['field_geo_position']['click_sort_column'] = 'geom';
$handler->display->display_options['fields']['field_geo_position']['type'] = 'geofield_geojson';
$handler->display->display_options['fields']['field_geo_position']['settings'] = array(
'data' => 'centroid',
);
/* Campo: Conteúdo: Diárias a partir de */
$handler->display->display_options['fields']['field_diarias']['id'] = 'field_diarias';
$handler->display->display_options['fields']['field_diarias']['table'] = 'field_data_field_diarias';
$handler->display->display_options['fields']['field_diarias']['field'] = 'field_diarias';
$handler->display->display_options['fields']['field_diarias']['label'] = 'diaria';
$handler->display->display_options['fields']['field_diarias']['settings'] = array(
'thousand_separator' => ' ',
'decimal_separator' => '.',
'scale' => '2',
'prefix_suffix' => 1,
);
/* Campo: Conteúdo: Telefone */
$handler->display->display_options['fields']['field_telefone']['id'] = 'field_telefone';
$handler->display->display_options['fields']['field_telefone']['table'] = 'field_data_field_telefone';
$handler->display->display_options['fields']['field_telefone']['field'] = 'field_telefone';
$handler->display->display_options['fields']['field_telefone']['label'] = 'telefone';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Critério de filtragem: Conteúdo: Publicado */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Critério de filtragem: Conteúdo: Tipo */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'hotel' => 'hotel',
);
/* Critério de filtragem: Conteúdo: Nid */
$handler->display->display_options['filters']['nid']['id'] = 'nid';
$handler->display->display_options['filters']['nid']['table'] = 'node';
$handler->display->display_options['filters']['nid']['field'] = 'nid';
$handler->display->display_options['filters']['nid']['exposed'] = TRUE;
$handler->display->display_options['filters']['nid']['expose']['operator_id'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['label'] = 'Nid';
$handler->display->display_options['filters']['nid']['expose']['operator'] = 'nid_op';
$handler->display->display_options['filters']['nid']['expose']['identifier'] = 'nid';
$handler->display->display_options['filters']['nid']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
$handler->display->display_options['path'] = 'content_hoteis';
$translatables['services_content'] = array(
t('Master'),
t('mais'),
t('Aplicar'),
t('Reiniciar'),
t('Ordenar por'),
t('Ascendente'),
t('Decrescente'),
t('nid'),
t('uuid'),
t('titulo'),
t('body'),
t('img'),
t('geo'),
t('Nid'),
t('Páginas'),
t('Noticias'),
t('UUID'),
t('anexos'),
t('Hoteis'),
t('diaria'),
t('telefone'),
);
Views Preview Output:
array (
0 =>
stdClass::__set_state(array(
'nid' => '6',
'uuid' => 'bcce3128-fce0-46f8-a5e8-1dff0a66d4e6',
'titulo' => 'Sobre o Evento',
'body' => '
Phosfluorescently pursue out-of-the-box total linkage without resource-leveling information. Holisticly fashion competitive outsourcing without bleeding-edge customer service. Rapidiously exploit accurate bandwidth through visionary customer service. Globally disseminate equity invested leadership for mission-critical mindshare. Holisticly syndicate unique initiatives for sticky processes.
Interactively target highly efficient communities rather than flexible niches. Appropriately expedite value-added bandwidth whereas 2.0 technology. Holisticly morph cross-media testing procedures via resource sucking services. Monotonectally promote fully tested testing procedures vis-a-vis alternative e-commerce. Interactively unleash bleeding-edge products rather than error-free bandwidth.
Globally redefine world-class partnerships and end-to-end initiatives. Dramatically integrate cross-platform sources whereas strategic ideas. Objectively predominate value-added content before installed base outsourcing. Holisticly negotiate enterprise e-tailers with functional core competencies. Credibly actualize clicks-and-mortar partnerships vis-a-vis multifunctional models.
Globally extend impactful imperatives after team driven outsourcing. Progressively productivate inexpensive paradigms rather than low-risk high-yield products. Authoritatively generate resource sucking "outside the box" thinking through scalable functionalities. Uniquely revolutionize orthogonal process improvements rather than exceptional infomediaries. Proactively mesh economically sound ROI before extensive leadership.
Interactively restore high standards in services before effective content. Globally extend an expanded array of schemas rather than clicks-and-mortar partnerships. Dynamically fabricate maintainable leadership through orthogonal niche markets. Quickly re-engineer professional customer service whereas scalable leadership. Competently aggregate dynamic technologies via vertical partnerships.
',
'img' =>
array (
'fid' => '5',
'uid' => '1',
'filename' => 'img-de-destaque.jpg',
'uri' => 'public://uploads/pagina/6/img-de-destaque.jpg',
'filemime' => 'image/jpeg',
'filesize' => '71720',
'status' => '1',
'timestamp' => '1403175415',
'origname' => 'estacao-ciencias-cultura-artes-cabo-branco-joao-pessoa.jpg',
'uuid' => 'e48735eb-eba8-485a-ab98-3226545cf0fa',
'width' => '576',
'height' => '384',
),
'geo' =>
array (
'geom' => 'POINT (-34.797995 -7.149378)',
'geo_type' => 'point',
'lat' => '-7.149378000000',
'lon' => '-34.797995000000',
'left' => '-34.797995000000',
'top' => '-7.149378000000',
'right' => '-34.797995000000',
'bottom' => '-7.149378000000',
'geohash' => '7nxr24kzggq7',
),
)),
)
Plus, I get a lot of these warnings after reload the REST resource, and soon after reload a Drupal page:
Warning: Invalid argument supplied for foreach() in element_children() (line 6433 of /www/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5898 of /www/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5908 of /www/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5946 of /www/includes/common.inc).
Warning: Illegal string offset '#printed' in drupal_render() (line 5953 of /www/includes/common.inc).
Comment | File | Size | Author |
---|---|---|---|
#33 | services_views-reference_column_support_21-2289431-32.patch | 522 bytes | Liam Morland |
#33 | services_views-reference_column_support_8-2289431-32.patch | 472 bytes | Liam Morland |
Comments
Comment #1
Marcus VBP CreditAttribution: Marcus VBP commentedComment #2
meba CreditAttribution: meba commentedCOnfirmed, happens with Media entities too
Comment #3
jantoine CreditAttribution: jantoine commentedI ran into this same issue when using core term_reference fields. The problems seems to stem from the fact that the result returned was an array of arrays rather than an array of single values. The attached patch detects if a column is set on the field and if each item is an array, and if so, uses the column to return the value of the array rather than the array itself. I have only tested this with term_reference fields, so it should be tested with all other core fields along with the entity_reference field.
Comment #4
jantoine CreditAttribution: jantoine commentedMy previous patch was incorrect and resulted in incorrect values being returned. It turns out that the item values should be renderable arrays as they are passed to the drupal_render() function. The problem seems to be that the module is not supplying enough information to actually render the value. The attached patch sets the type to 'markup' and sets the value to the '#markup' key. This may not be correct, but it's the only type I could get to work.
Comment #5
DarkteK CreditAttribution: DarkteK commented#4 worked for me really great, please include this in the next version :)
Comment #6
ahmed.raza CreditAttribution: ahmed.raza commentedHaving the same problem patch #4 didn't work for me :( please help
Comment #7
othermachines CreditAttribution: othermachines commentedThis needs a reroll.
Comment #8
Brolad CreditAttribution: Brolad at Skilld commentedComment #9
thedut CreditAttribution: thedut commented#8 fix the issue for me.
Comment #10
rossb89 CreditAttribution: rossb89 at ComputerMinds commentedYup, #8 solves the issue.
Comment #11
rossb89 CreditAttribution: rossb89 at ComputerMinds commentedComment #12
Rishi Kulshreshtha#8 solves the issue, please include this in the next version :)
Comment #13
ice70 CreditAttribution: ice70 commentedHi,
I was having the same problem, applied the patch in #8 and now I have the following
Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1422 of \sites\all\modules\contrib\views\handlers\views_handler_field.inc).
Notice: Array to string conversion in drupal_render() (line 6075 of \includes\common.inc)
the JSON feed looks ok, but I am filling up my log with these errors?
Any ideas?
Thank you for your help
ice70
Comment #14
ice70 CreditAttribution: ice70 commentedHi,
I am seeing a similar error pattern.
For this error:
Notice: Array to string conversion in drupal_render() (line 6075 of \includes\common.inc)
which is:
$output = $prefix . $elements['#children'] . $suffix;
I am using bootstrap & media modules and when I have an image in the view data, $elements is as follows:
the view field export is as follows:
any ideas on how to make #children a string, not an array?
Thank you for any help,
ice70
Comment #15
ice70 CreditAttribution: ice70 commentedHi,
in
services_views.module: services_views_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display)
we go through a loop for a media image with services raw output:
$element[$delta] = $filtered_item;
$filtered_item contains:
causing "Notice: Array to string conversion in drupal_render()"
Any suggestions on how to prevent this?
thank you for your help,
ice70
Comment #16
karthid CreditAttribution: karthid as a volunteer and commentedTry this one.
Comment #17
Liam MorlandComment #18
bisonbleu CreditAttribution: bisonbleu commentedRan into issue reported in #14.
Code in #16 fixed this issue.
Thanks @karthid !
Comment #19
fakir22 CreditAttribution: fakir22 commentedI was having same warnings that #1 and the patch in #8 fixed the issue for me.
Comment #20
Liam Morland@bisonbleu; Could you write-up a patch of what you did?
Comment #21
bisonbleu CreditAttribution: bisonbleu commentedSure thing @Liam Morland. Cheers.
Comment #22
arled CreditAttribution: arled commentedThis fixes the warnings but breaks the services output settings. You are always left with #markup and can't produce clean output. I would not recommend this as the solution. And what's with pasting so much code!!
Comment #23
bisonbleu CreditAttribution: bisonbleu commented@arled , care to share what you would recommend?
Comment #24
zuhair_ak@arled Do you have any other solution than the one in the patch? Thanks.
Comment #25
sepa_cleversoft CreditAttribution: sepa_cleversoft commented#8 worked well for me!! Thanks!! please add in next version.
Comment #26
Brolad CreditAttribution: Brolad at Skilld commented#8 can solve the issue but the patch is wrong, need to make some changes
Comment #27
zuhair_akCould you give some pointers on what are the changes to be made?
Comment #28
Getekid CreditAttribution: Getekid as a volunteer commentedHello everyone,
I stumbled upon this error as well and I discovered that the output of the formatter has no effect whatsoever, i.e. in
services_views_field_formatter_view
even if you return:the output in both the View preview and the final service output will be the actual field content, with no errors, too.
I haven't figured out the code completely, but by looking at the
services_views_execute_view
function (under "services_views.resource.inc") it seems that as long as the field is in the row results and has theservices
formatter, it will still append all the field content ("skip_safe" and "skip_empty_values" are still checked) to the final outcome, regardless of the formatter output.If that's the case maybe the formatter is unnecessary and a view field option would suffice to output the raw content of the field.
Comment #29
solideogloria CreditAttribution: solideogloria commentedYou shouldn't use
'#type' => 'markup'
. The property was removed and never actually did anything.https://www.drupal.org/node/2036237
Comment #30
Liam Morlandmarkup
is a valid#type
. It is also the default so there is no need to declare it.https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
Comment #31
Liam MorlandUniversity of Waterloo has been running #8 for over three years now.
However, I note there are now test failures.The failures are on the branch, not related to the patches in this issue.
Comment #32
solideogloria CreditAttribution: solideogloria commentedRemoving duplicate warnings to reduce size of initial post.
Comment #33
Liam MorlandHere are re-rolls of both #8 and #21. The only difference is whether they do the
!is_array($val)
check.