Drupal 10.1.2
In our test setup we created a view using Custom Elements as the formatter and tried with content, and fields and nothing renders in the preview. Once you check this on the Nuxt end you get "A client error happened".
And this is in the Drupal Logs:
User error: "0" is an invalid render array key in Drupal\Core\Render\Element::children() (line 98 of /var/www/html/web/core/lib/Drupal/Core/Render/Element.php)
Message User error: "total_pages" is an invalid render array key in Drupal\Core\Render\Element::children() (line 98 of /var/www/html/web/core/lib/Drupal/Core/Render/Element.php)
Message User error: "current" is an invalid render array key in Drupal\Core\Render\Element::children() (line 98 of /var/www/html/web/core/lib/Drupal/Core/Render/Element.php)
We also went ahead and updated the view formatter to unformatted and the preview rendered the title however the Nuxt end gave the same error.
Any thoughts or suggestions as to what we need to change? Perhaps this is not working with Drupal 10 at this stage?
Issue fork lupus_decoupled-3380863
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
glynster commentedComment #3
glynster commentedThanks to @fargo Drupal demo video I managed to get the views working:
https://www.youtube.com/live/KKTl4z_MGSg?si=j4qWfVlo9IOiobDy&t=1352
The step I was missing was to create a new view display with "Custom Elements Display" and then set to content instead of fields.
This removes the php errors and leaves only the following warning in the logs:
Warning: Undefined array key "title" in Drupal\lupus_decoupled_views\Controller\ViewsController->viewsView() (line 62 of /var/www/html/web/modules/contrib/lupus_decoupled/modules/lupus_decoupled_views/src/Controller/ViewsController.php)Comment #4
useernamee commentedThank you @glynster to finding that out.
We have a new todo:
Create documentation on lupus_decoupled_views (add README.md to the lupus_decoupled_views module and/or provide it here https://lupus-decoupled.org/advanced-topics/views)
Comment #5
glynster commentedHappy to help where I can.
Comment #6
fagoThanks! Let's use this issue for the missing documentation. I'd recommend adding it to the linked page on lupus-decoupled.org, then maybe have a point to the page in the README. You could help with that simply by filing a PR against https://github.com/drunomics/lupus-decoupled-website to add it!
For the mentioned problem, it might be a compatibility issue on Drupal 10.1 - let's reproduce it with a gitpod. Could you open a dedicated ticket for the bug? Then let's solve it there. Then we need to work on test-coverage fro this (follow-up)
Comment #7
fagoI tested it on gitpod and was able to reproduce the error. So filing a bug-ticket as sub-task here.
Comment #8
fago@lio - coudl you help with that? I think you already started here.
Comment #9
useernamee commentedOn it.
Comment #11
useernamee commentedOk, I'm not sure how good this solution is, but the errors are gone and there is a simple preview of what custom element view will show.
Other option would be, to disable it.
Comment #12
fagoNot sure about the error, but yes we should fix it. But this issue is about documentation - which i don't see anywhere, so it'S not ready for review -> setting this back to needs work.
Let's open a dedicated issue for the bug please + move the MR over. Making the preview work would be nice, but we should avoid a second code-path. If not easy, anything which avoids the error would be good enough as quick-fix.
Comment #13
useernamee commented@fago, I started on it here because of #3.
I'll move it into #3469398: When editing a custom elements page view php errors are produced by renderer.
Comment #16
useernamee commentedCreated MR96 and subpage on lupus-decoupled.org https://github.com/drunomics/lupus-decoupled-website/pull/74
Comment #18
fagoadd