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?

Command icon 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

glynster created an issue. See original summary.

glynster’s picture

Issue summary: View changes
glynster’s picture

Thanks 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)

useernamee’s picture

Thank 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)

glynster’s picture

Happy to help where I can.

fago’s picture

Title: Default view or setup steps » Documentation for default view or setup steps
Category: Bug report » Task

Thanks! 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)

fago’s picture

I tested it on gitpod and was able to reproduce the error. So filing a bug-ticket as sub-task here.

fago’s picture

Assigned: Unassigned » useernamee

@lio - coudl you help with that? I think you already started here.

useernamee’s picture

On it.

useernamee’s picture

Status: Active » Needs review

Ok, 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.

fago’s picture

Status: Needs review » Needs work

Not 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.

useernamee’s picture

@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.

useernamee’s picture

Assigned: useernamee » fago
Status: Needs work » Needs review
Issue tags: +views, +Documentation

Created MR96 and subpage on lupus-decoupled.org https://github.com/drunomics/lupus-decoupled-website/pull/74

  • fago committed 69551f25 on 1.x authored by useernamee
    Issue #3380863 by useernamee, fago: add documentation for Views setup
    
fago’s picture

Title: Documentation for default view or setup steps » add documentation for Views setup
Status: Needs review » Fixed

add

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.