Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save changes in layout editor #1591

Open
mworion opened this issue Jan 23, 2025 · 7 comments
Open

Can't save changes in layout editor #1591

mworion opened this issue Jan 23, 2025 · 7 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@mworion
Copy link

mworion commented Jan 23, 2025

Current Behavior

Using the layout editor works nicely, but when save the changes I get an 400 Error

Image

Expected Behavior

Can save the changes

Steps To Reproduce

Open a layout page in edit mode, make some changes and try to save them

Environment

  • Dashboard version: 1.22
  • Node-RED version: 4.05
  • Node.js version:
  • npm version:
  • Platform/OS: RPi
  • Browser: Chrome / Safari

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@mworion mworion added bug Something isn't working needs-triage Needs looking at to decide what to do labels Jan 23, 2025
@bartbutenaers
Copy link
Contributor

Hi @mworion

Did a quick test, but for me the problem doesn't occur.
Perhaps you can share some more detailed info so people can assist you better.

  • Any errors in your browser console log?
  • Any errors in your Node-RED log on your RPi?
  • Does it also happen when you create a new page with very few content?
  • Other stuff that might help?

@mworion
Copy link
Author

mworion commented Jan 25, 2025

Many thanks for the hints,

attached the error message in the browser console log:

Image

No errors seen on the node-red-log. It is only a test page with one group.

Hope this helps.
Michel

@bartbutenaers
Copy link
Contributor

Thanks for the info!

No errors seen on the node-red-log

I had hoped that the endpoint (which processes the request on the Node-RED server side) would log a bit of information about what is wrong in the request. If anybody knows which endpoint that is, please share it here! Otherwise I need to start searching myself. Hopefully it is a dashboard specific endpoint, so we can enhance it a bit. Imho the endpoint:

  • should log what (he assumes) is wrong in the request.
  • should be fixed because all stuff you put in the request should be correct content, since you have composed the request automatically by simply drawing a layout using the editor.

It is only a test page with one group.

Yes but I see multiple widgets in that group. I am wondering when the error happens. Do you get the error immediately for a group containing only a single widget? If not it would be helpful for the developers in this repo to know when the error starts occuring, for example as soon as you add a dropdown to your group. That would really be helpful in troubleshooting why the request content is generated incorrectly.

I am not familiar with the layout editor, so hopefully I am not telling nononsense here...

@bartbutenaers
Copy link
Contributor

@mworion,

Beside the questions from my last post, I have another question.

In the endpoint code (which is responsible for saving your page on the server-side), there seems to be a lot of error handling code available. For lots of those errors, a http status 400 is being returned to the browser, and extra information is included in the response. That might us also provide some more information...

Could you:

  1. Open the developer tools of your browser.
  2. Open the "Network" tabsheet of the developer tools.
  3. Click the save button in the dashboard editor.
  4. The (failed) http request should now appear in the Network tabsheet.
  5. Click on that failed request, and go to the "Response" sub-tabsheet.
  6. Share a screenshot of that response.

For example in my case it always succeeds, and it seems that then a revision number is being returned:

Image

Hopefully that gives us a clue...

@gewy
Copy link

gewy commented Jan 28, 2025

I have the same bug.
In the response I have :
{"error":"Widget not found","code":"WIDGET_NOT_FOUND"}
or same message with Group not found.

@bartbutenaers
Copy link
Contributor

Hi @gewy,

Thanks for the feedback!! It might be that it is a different problem as the one from @mworion, because the endpoint can respond with all kind of errors.

If you know a way how I can reproduce that problem (i.e. some list of steps I can follow), I will try to have a look at it.

@gewy
Copy link

gewy commented Jan 28, 2025

Hi,
The problem is linked to the use of ui node in subflow.
With dashboard v1 I could have a subflow with ui node and I was abled to add several time the same subflow. Each subflow was added on the same page and everything was working at one condition, to create the page and group from the subflow.
With dashboard v2 when I create the page/group from a subflow I can't open the Layout Editor, I have the message "Unable to begin layout editor".
If the page/group, created outside the subflow, is used in a subflow I have the 400 error when I want to save the changes from the Layout Editor.
So I am very confused about all of this. For my special use, the option to have ui-nodes in a subflow is very useful.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

3 participants