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

"Save" not working on /features #9416

Closed
ebarry opened this issue Apr 1, 2021 · 23 comments
Closed

"Save" not working on /features #9416

ebarry opened this issue Apr 1, 2021 · 23 comments
Assignees
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute

Comments

@ebarry
Copy link
Member

ebarry commented Apr 1, 2021

Please describe the problem (or idea)

What happened just before the problem occurred? Or what problem could this idea solve?
As an Admin, I edited text in a Feature, then clicked Save. The page reloaded with a "This page does not exist" screen, see screenshot. I also tested clicking "Save" without editing, with the same result.

Screen Shot 2021-04-01 at 10 08 36 AM

What did you expect to see that you didn't?
I expected to see my edits successfully saved.

Please show us where to look

https://publiclab.org/features/17211
https://publiclab.org/features/11796/
and for Jeff: https://publiclab.slack.com/archives/CV7KG8MFT/p1617198609007000

What's your PublicLab.org username?

bhamster
liz

Thank you!

@ebarry ebarry added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label Apr 1, 2021
@cesswairimu cesswairimu added the help wanted requires help by anyone willing to contribute label Apr 3, 2021
@cesswairimu cesswairimu self-assigned this Apr 3, 2021
@daemon1024
Copy link
Member

Noting some finding that may assist in solving this.

When we try to edit and save in local development environment, the route seems to throwing off an exception.

No route matches [POST] "/features/<id>"

It should be calling update features controllers.

<% url = { :controller => "features", :action => "update", :id => @node.id } %>

the update controller hasn't been updated for quite a while so not exactly sure what changed that is throwing off this exception now.

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Wow very much appreciated! I got drawn into an adjacent bug 😅

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

I'll check the routes.rb file!

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

I really don't see much in routes.rb...

@daemon1024
Copy link
Member

I checked the the routes, there's no POST method for features/:id

@daemon1024
Copy link
Member

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

indeed. i think it probably uses a more general matcher, or is implicit since it's a resource?

resources :features

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

The broken feature was last edited 2 months ago so i'm thinking there have only been a couple site republishes since then anyways! So strange!

@daemon1024
Copy link
Member

I will look into if we had any changes in the node model, since the stackoverflow solution seems to be pointing towards there.

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Aha, i like your theory on the form_for code, i think that's probably it. See this change: #8923

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

I'll try reverting that change in local and checking the generated url of the form in HTML...

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

OK, current form shows <form action="/features/11796" accept-charset="UTF-8" method="post">

let me see after reverting this form_for change...

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Hmm. Reverting :node to @node makes it <form class="edit_drupal_node" id="edit_drupal_node" action="/features/44" accept-charset="UTF-8" method="post">

looks pretty similar... let me inspect the whole form, maybe even try submitting it and inspecting the package sent...

@daemon1024
Copy link
Member

-<%= form_for :node, :as => :drupal_node, :url => url do |f| %>
+<%= form_for @node, :as => :drupal_node, :url => url do |f| %>

This solved it :)

@daemon1024
Copy link
Member

@node was changed to :node unknowingly i guess.

@daemon1024
Copy link
Member

Hmm. Reverting :node to @node makes it <form class="edit_drupal_node" id="edit_drupal_node" action="/features/44" accept-charset="UTF-8" method="post">

looks pretty similar... let me inspect the whole form, maybe even try submitting it and inspecting the package sent...

Ohh I missed this.

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Agreed. I'm going to try triggering a validation error to see if the displayed messages still work, as that was the target of the fix.

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Looks ok!

image

I guess maybe it was a mistaken or unrelated change?

I'll rush this into production but we should back it with an integration test. That could be a pretty good FTO!

@daemon1024
Copy link
Member

🎉

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

99e0157 and monitoring the tests before merging to stable and publishing!

@jywarren
Copy link
Member

jywarren commented Apr 6, 2021

Thank you so much, @daemon1024 !!!

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute
Projects
None yet
Development

No branches or pull requests

4 participants