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

Unable to immediately click edit after re-ordering page when changing hierarchy level #1985

Closed
mattruggio opened this issue Oct 11, 2012 · 9 comments · Fixed by #2084
Closed

Comments

@mattruggio
Copy link

Hey guys, love Refinery and want to help make it better by reporting/helping fix bugs. Here is an issue I am running across when using 2.0.0 and Ruby 1.9.3:


Showing /Users/mattruggio/.rvm/gems/ruby-1.9.3-p194/gems/refinerycms-pages-2.0.8/app/views/refinery/admin/pages/_form.html.erb where line #2 raised:

undefined method `persisted?' for nil:NilClass
Extracted source (around line #2):

1: <%= form_for [refinery, :admin, @page],
2:              :url => (refinery.admin_page_path(@page.uncached_nested_url) if @page.persisted?) do |f| %>
3: 
4:   <%= render '/refinery/admin/error_messages', :object => @page, :include_object_name => true %>
5: 

Reproduce by:

  1. Create root page (A)
  2. Create another root page (B)
  3. Create child page for A.
  4. Reorder child page to now live under B as a parent.
  5. Save
    6 Click edit for child page (do not refresh - it will work on a refresh/fresh get)

Thoughts?

@ugisozols
Copy link
Member

Hey @mattruggio,

Can you try latest stable version (2.0.8)? I'm pretty sure we fixed similar issue.

@mattruggio
Copy link
Author

My gemfile include was: gem 'refinerycms', '~> 2.0.0' which was yielding the latest 2.0.8.

I did try to change this to use the 2-0-stable branch using this include: gem 'refinerycms', :git => "https://github.com/refinery/refinerycms.git", :branch => "2-0-stable"

After bundle updating, the 2-0-stable branch still threw the exception.

Is this something that currently works and does not throw an error on your end?

@ugisozols
Copy link
Member

I can reproduce so this is a valid issue.

@GeoffTidey
Copy link

We're seeing this issue as well. Is there a known work around already?

Refinery 2.0.8
ruby 1.9.3p194

@robyurkowski
Copy link
Contributor

The reason why this happens is because pages are written with their parent pages in the URL. When we move the page, it doesn't rewrite the URL, so it tries to find the new page and can't.

@parndt
Copy link
Member

parndt commented Nov 10, 2012

I believe this may be fixed in 2.0.9 once Rails 3.2.9 comes out

@gwagener
Copy link
Contributor

I am still able to reproduce this with 2.0.9 on Ruby 1.9.3-p327.

@ugisozols
Copy link
Member

Yes, it is still a valid issue.

@parndt
Copy link
Member

parndt commented Dec 17, 2012

Drat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants