-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
error on translate pages #1461
Comments
So you've modified the code and it's not working for you? Can you provide a default application (without modification) that fails? |
Hi, with modification works fine. The urls (on admin) are now only with page id, not slugs, and working fine.. I can try to reproduce error on sqlite db and send to you because my application is in production.. |
From fresh install i get the same
Refinery::I18n.configure do |config|
config.current_locale = :ru
config.default_locale = :ru
config.default_frontend_locale = :ru
config.enabled = true
config.frontend_locales = [:ru, :en]
config.locales = { :en => 'English', :ru => 'Русский' }
end
NoMethodError in Refinery::Admin::PagesController#update undefined method `update_attributes' for nil:NilClass
|
Maybe page translation resource was not builded before update_attribute ? |
I think this is related
|
Checked another time. All the same. Problem can be reproduced only on nested pages with translation |
@parndt the problem reported by @kalabiyau it's exactly like my.... so, the changes that i made.. line 16 to refinery.edit_admin_page_path(page.id, :switch_locale => translation.locale), line 2 to :url => (refinery.admin_page_path(@page.id) if @page.persisted?) do |f| %> so i think that can be used only page ids on admin, slugs are not necessary.. |
but it is not in the master yet? |
i not pushed to repo, i dont know if is the best option... solve to me and posted to exterts evaluate :) |
do you get that file with the override rake task? this doesn't work: bundle exec rake refinery:override view=refinery/admin/pages/page |
i get directly from github... but you can use bundle exec rake refinery:override view=refinery/admin/pages/_page :) |
thanks! |
Thank you for solution! |
@gabpaladino thanks! |
Here is some brainfood (thanks to @phiggins, who brought up some interesting points on this topic) Solutions for the backend: @phiggins input related to this:
The following part covers three solutions and their explanations I've been going through. See it as a starting point for a discussion on a proper solution.
Solution for the frontend: @phiggins input:
My humble oppinion is as follows:
|
Hi @renegr, i think that option 3 it's convenient for backend, we dosen't need seo in backend and it's more simple! I not tested the frontend question but my opnion is to make a 301 redirect to the "/es/mi-casa" or "en/home", but i have no ideia if the language or page has preference... hehehehe. so the 404 error can be a good solution too. |
My 2c: Ideally the backend and frontend should be using identical routing so that a problem on the frontend is also a problem on the backend which would help us to make routing work perfectly in both situations. Edge cases / differences make programming harder :-) |
Hi, @parndt I agree: I think that it would be a nice solution from the programmers view. But this would mean that the only proper solution is number 1 (if we want to retain the pretty-url feature :-)) so far. Which - in my opinion - is kind of ugly from the users view (backend as well as frontend)... What I tried to outline in the examples above, is that the use-cases of paths are of so much more variety in the backend as in the frontend. The problems that have to be faced in the backend are not to be faced in the frontend, which makes it kind of different problems to me (in detail, see above: big differences in terms of complexity) Number 4 seems to me not a valuable solution anymore, because it would make it hard to resolve paths which are named e.g. "4" and has an ID of "20". When the paths reads At the moment I can not think of a nice solution that solves both fields (backend and frontend), without confusing user and without confusing programmer, since - once again - the backend faces so much more problems, then the frontend should ever face ... Thanks for your thoughts! Looking forward for a leap on this topic! |
We've made a lot of changes recently to functionality around this. Is the current [master/2-0-stable] functionality still buggy? |
Hi @parndt i will test the lastest changes and return with news. |
i tried using 2-0-stable and it's still buggy |
I am currently experiencing the same problem, running refinerycms-core-2.0.5. Any news on this? |
I just noticed that 2.0.8 is out already. Just upgraded; seems like that problem still exists. |
Same here with 2.0.8, I used gabpaladinos changes to fix this for now. |
I confirm that version 2.0.8 still has this bug, and needed to use gabpaladino's fix |
Thank you soo much for this fix. I saved me a lot of time. |
@pavelnikolov which comment are you referring to? |
I used the override rake task like this:
and then applied the changes suggested by @gabpaladino so now everything works like a charm |
@parndt When do we want to deal with this one? Should we try to slam it in for 2.1 or should this be pushed to 3.0? |
2.1 or 2.2 if possible |
Investigating.. |
Fixed by #2088 |
Updated to globalize3 version 0.3.0 Fixes #1461
Updated to globalize3 version 0.3.0 Fixes #1461 Conflicts: Gemfile core/refinerycms-core.gemspec pages/app/controllers/refinery/admin/pages_controller.rb pages/app/models/refinery/page.rb pages/app/views/refinery/admin/pages/_form.html.erb pages/app/views/refinery/admin/pages/_locale_picker.html.erb pages/app/views/refinery/admin/pages/_page.html.erb
i still get the error with the latest code from
i no longer have to override the the difference it makes is that in my case
somehow
thanks |
This was fixed in master not 2-0-stable |
@parndt i verified that your pull/commit was applied to 2-0-stable as well |
@harleyttd: Doubting Thomas :) |
@simi :) thanks i'll be better next time https://github.com/refinery/refinerycms/commits/2-0-stable shows that @parndt's pull #2088 was merged on Dec 20, 2012 i did mention that i also verified that my bundled version of refinerycms is up to date with the latest commit in that branch sorry if i miss anything obvious |
Oh sorry, I guess I did write this for 2-0-stable in the first place.. I'll see if I can reproduce your case. |
Confirm the issue still exists 😢 |
@harleyttd please try updating to the latest 2-0-stable, this works now for me 👍 |
ah hah nice fix! confirmed this works for me too. thanks so much! |
… viable slug. Fixes refinery#1461
The bug still exists for me in refinery 2.0.10.. I'm importing a existing page structure from another CMS which has a deeply nested page structure. The admin generates urls like this: |
How are you importing the page structure? |
I just loop the old CMS page structure and create the Pages and PageParts manually. |
Just updated to refinery edge, still having the same bug. |
For anyone that may still have this problem, it's worth checking this file: pathtoyourapp/config/initializers/refinery/i18n.rb You may have forgotten to set config.frontend_locales with the languages/locales that your site supports, in my case: config.frontend_locales = [:en, :'pt-BR'] After doing so, don't forget to restart the server =) This worked for me (Refinery 2.1.1), no pages overrides needed |
i have some problems on translate pages on version 2.0.1 with ruby 1.9.3
basically errors caused by wrong urls. i fix change the admin templates (page and form) to use page.id and not uncached_nested_url on links and form action.
error occours on...
About
| - The Company
| - Clients
.............
So i translate About page, then i will translate The Company, but the url like "about/5" generate a page nil object on form.
I changed on page partial and ok, so again on form action i have a put action "about/5" thats generate a undefined method 'update_attributes' for nil class.. so again i edit form partial and change action to use only page.id
The text was updated successfully, but these errors were encountered: