For every search result in content search, I get the following error in the log:
User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (line 102 of .../core/lib/Drupal/Core/Render/Element.php).
To reproduce:
Drupal 8.0.x-dev, standard profile.
create a few articles, and index them using cron.
search for something, and check the recent log messages.
enable the module, then refresh the search results page, and the recent messages page.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | custom_search-attributes.patch | 1.43 KB | BenGeeFr |
| #20 | custom_search_settings.pdf | 92.83 KB | Anonymous (not verified) |
| #20 | custom_search-8.x-1.x-dev_error.txt | 4.83 KB | Anonymous (not verified) |
| #20 | custom_search-8.x-1.0-beta5_error.txt | 4.91 KB | Anonymous (not verified) |
| #11 | error_message.txt | 5.55 KB | jwineichen |
Comments
Comment #2
martinma commentedJusrt had the same problem too, with 8.1 RC and 8.1.0
Also got following message:
Notice: Undefined index: route:/search/node:keys=gr%C3%BCn%20wien in Drupal\Core\Cache\DatabaseBackend->getMultiple() (line 97 of core/lib/Drupal/Core/Cache/DatabaseBackend.php).
Comment #3
Q2U commentedEvery time I run a search on both Custom Search 8.x-1.0-beta3+1-dev and 8.x-1.0-beta3 the following error is thrown. I'm running Drupal 8.1. The search results appear below the following error...
Comment #4
Q2U commentedComment #5
jdanthinne commentedCan you try the following patch?
Comment #6
Q2U commentedThank you for the patch. Your work is greatly appreciated!
I applied the "custom-search-2655118-attributes.patch" to my (d8.1) Custom Search "8.x-1.0-beta3+1-dev (2016-Mar-18)" install.
Unfortunately applying the patch did not appear to resolve the targeted "Attributes Issue"...and it appears to have introduced a second (new) issue which occurs when I configure/edit my Custom Search block (Home > Administration > Structure > Block layout > Configure Custom Search form).
Below I have pasted the (new) "Custom Search block edit error" first and then (below that) I have pasted the "Attributes Error" which precedes the results of a test Custom Search.
The errors pasted below occurred after I had applied the "custom-search-2655118-attributes.patch".
Error produced when configuring Custom Search form block
(Home > Administration > Structure > Block layout > Configure Custom Search form)...
"Attributes Error" which precedes the results of a test Custom Search...
Comment #7
jdanthinne commented@Q2U: For the additional errors, can you try patch at https://www.drupal.org/node/2727737#comment-11203793
Comment #8
vitalym commentedComment #9
jwineichen commentedStill getting the same errors after applying the patch
Comment #10
mario steinitz@pizzabrarian: Can you please elaborate, or confirm that the error is fixed? - I'm unable to reproduce this behavior with the current dev version. If the error still occurs, up-to-date error logs would be great. Please post them as file attachments, rather than inline text.
Comment #11
jwineichen commentedYeah, I am still getting the error. Here's what I did to get it:
1. Fresh install of 8.2.6
2. Create some content and index it with cron
3. Do a search of that content; no error
4. Install Custom Search, version 8.x-1.0-beta4+9-dev (2017-Mar-06)
5. Do same search; now you get the attribute error
6. Apply patch from #5
7. Do same search; still get error
8. Uninstall Custom Search
9. Do same search; no more error
All of the content shows up in the search results like it should, but you get the error in the logs. If you have error messages set to display, you get is this with the search result:
User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).
I've attached a file of the message that gets logged.
Comment #12
Q2U commented+1 here.
My D8.2.x Custom Search, version 8.x-1.0-beta4+9-dev (2017-Mar-06) is also resulting in the "User error: "attributes" is an invalid render array key in Drupal\Core\Render" error.
Comment #13
Anonymous (not verified) commentedI also get the same error message. I'm using Drupal 8.2 and Custom Search 8.x-1.0-beta5, but have had this same error message for all earlier versions of Drupal 8 and Custom Search.
Comment #14
Q2U commentedApologies and clarification: I am running Custom Search 8.x-1.0-beta5 (2017-Mar-06 )
Comment #15
mario steinitzComment #16
mario steinitzThanks everybody for providing more feedback. Yet, I'm having a hard time to reproduce this error. I followed all steps described by pizzabrarian, setup a new D8 instance (standard installation profile, with Bartik enabled), created dummy content using devel_generate, ran cron to create the search index, installed custom_search in current 1.x-dev version, and searched a whole lot of terms using the custom search block and the standard search without having any errors or warnings in any logs.
Did you alter any settings on the node_search page (admin/config/search/pages/manage/node_search) as well? If so, could you please provide your configuration?
Comment #17
mario steinitzOk, I found some issues with search result pre-processing and the templates provided by the custom_search module after altering some settings in admin/config/search/pages/manage/node_search. They have been fixed within the development version of the module.
As I could not reproduce the above errors, but found they might be related to the fixes done, please have another check with your installations.
Comment #18
mario steinitzComment #19
oheller commentedI just updated to the current dev version 8.x-1.0-beta5+5-dev and using Drupal 8.2.6.
I'm still experiencing the error: User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of /code/core/lib/Drupal/Core/Render/Element.php). Although I am seeing more instances of the error generated that previously. Previously I searched for a result that had 2 results and I got 2 errors, now the same search yields 4 errors.
We have all the search form selections checked and all the Results information checked, but no filter. All of the Factor Influence is 0, and our url is /node.
Here is the full output:
Comment #20
Anonymous (not verified) commentedI'm still getting the an error message with the development version, but still only one error message per search result. Copies of the message using 8.x-1.0-beta5 and 8.x-1.x-dev are attached. Also attached is a representation of the configuration on the settings page.
Comment #21
BenGeeFr commentedHi
I made a simple patch to fix the "attributes is an invalid render array key" and "Undefined Index" errors I had on every search results, if it can help someone
Comment #22
jwineichen commented#21 fixed the issue. Not getting any more errors after applying the #21 patch to the beta5 dev.
Comment #23
Anonymous (not verified) commented#21 fixed the issue for me as well. Thanks very much.
Comment #25
mario steinitzThank you for your patch @benjamin-vasseur. I applied it yesterday to the code base (dev and new beta version). As I still could not reproduce the error, I rely on all other participants of this issue for testing.
Will set the issue to 'Reviewed & tested by community' now and close it in a short while, if no further issues are come up in near future.
Comment #26
npcoder commentedI recently update Drupal core to 8.7.8. I'm not sure it's due to update or not, but I had not that issue before.
I tried to search on the Internet but could not figure out "User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of /htdocs/core/lib/Drupal/Core/Render/Element.php) "
The error listed is:
Comment #27
liam morlandBased on #25, this appears to be fixed.
@#26: If you are still having this problem on the latest version, I suggest opening a child ticket.