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

NoMethodError in CamaleonCms::Admin#dashboard #687

Closed
kriskoli opened this issue Sep 14, 2017 · 16 comments
Closed

NoMethodError in CamaleonCms::Admin#dashboard #687

kriskoli opened this issue Sep 14, 2017 · 16 comments

Comments

@kriskoli
Copy link

I have integrated Camaleon cms with the existing app.But after I have created my admin panel, there is the following issue when try to log in to admin panel.
screen shot 2017-09-14 at 04 14 48
Did anyone get the same issue?
Please help me.

@owen2345
Copy link
Owner

Please put the full error message

@kriskoli
Copy link
Author

Hi, owen.
I have got the following trouble in terminal.

ActionView::Template::Error (undefined method name' for {:name=>"Dashboard", :url=>"/en/admin", :options=>{}}:Hash): 3: <html lang="en"> 4: <head> 5: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 6: <title><%= raw cama_admin_title_draw %></title> 7: <meta http-equiv="X-UA-Compatible" content="IE=edge"/> 8: <meta name="viewport" content="width=device-width, initial-scale=1"/> 9: <%= stylesheet_link_tag "camaleon_cms/admin/admin-manifest", media: "all" %> lib/rack/seoredirect.rb:20:in call'

Thanks.

@owen2345
Copy link
Owner

Fixed! pls test using github version

@kriskoli
Copy link
Author

Owen, Thanks a lot,
After github version is installed, the bug is fixed.
But I have another problem now.

ActionView::Template::Error (undefined method html_safe' for {:tag=>:li, :separator=>""}:Hash): 1: <% if @breadcrumbs.present? %> 2: <ul class="breadcrumb <%= options[:class] %>"> 3: <% separator = divider.html_safe %> 4: <% @breadcrumbs[0..-2].each do |crumb| %> 5: <li class="<%= options[:item_class] %>"> 6: <%= link_to crumb[:name], crumb[:url], crumb[:options] %> lib/rack/seoredirect.rb:20:in call'

Greetings for your help.

@kriskoli
Copy link
Author

I have fixed that.

Thanks for great CMS.

@kriskoli
Copy link
Author

Hi, owen.
After I have fixed the problem, there is the following issue.
screen shot 2017-09-15 at 14 25 22

I have noticed that there is the trouble in breadcrumb_on_rails gem, and fixed the issue by revising
the <%= render_breadcrumbs :tag => :li, :separator => "" %> to <%= render_breadcrumbs %>.

Regards.

@kriskoli kriskoli reopened this Sep 15, 2017
@owen2345
Copy link
Owner

Can you review the logs to check request params and verify if there is slug value?
If it is not present, pls review if there is an javascript error by javascript console which is affecting the slug generator.

@kriskoli
Copy link
Author

I have reviewed the javascript error in console.
That is :
screen shot 2017-09-15 at 14 57 37

screen shot 2017-09-15 at 14 58 14

Thanks a lot.

@brian-kephart
Copy link
Collaborator

I am also experiencing a breadcrumb error since the last commit. Relevant stack trace:

FATAL -- : [e941c34e-f0cb-44fe-b1fb-bc91b3a2d0b3] ActionView::Template::Error (undefined method `[]' for #<BreadcrumbsOnRails::Breadcrumbs::Element:0x00007fe0aa1d6f90>):
FATAL -- : [e941c34e-f0cb-44fe-b1fb-bc91b3a2d0b3]     3: <html lang="en">
     4: <head>
     5:     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     6:     <title><%= raw cama_admin_title_draw %></title>
     7:     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
     8:     <meta name="viewport" content="width=device-width, initial-scale=1"/>
     9:     <%= stylesheet_link_tag "camaleon_cms/admin/admin-manifest", media: "all" %>
FATAL -- : [e941c34e-f0cb-44fe-b1fb-bc91b3a2d0b3]   
FATAL -- : [e941c34e-f0cb-44fe-b1fb-bc91b3a2d0b3] vendor/bundle/ruby/2.4.0/bundler/gems/camaleon-cms-c98ed9f56b15/app/helpers/camaleon_cms/admin/breadcrumb_helper.rb:5:in `block in cama_admin_title_draw'
vendor/bundle/ruby/2.4.0/bundler/gems/camaleon-cms-c98ed9f56b15/app/helpers/camaleon_cms/admin/breadcrumb_helper.rb:5:in `each'
vendor/bundle/ruby/2.4.0/bundler/gems/camaleon-cms-c98ed9f56b15/app/helpers/camaleon_cms/admin/breadcrumb_helper.rb:5:in `cama_admin_title_draw'
vendor/bundle/ruby/2.4.0/bundler/gems/camaleon-cms-c98ed9f56b15/app/views/layouts/camaleon_cms/admin.html.erb:6:in `_vendor_bundle_ruby_______bundler_gems_camaleon_cms_c__ed_f__b___app_views_layouts_camaleon_cms_admin_html_erb___3685030159700069274_70301466949620'

Thanks again for all your work on this CMS @owen2345! It really is fantastic.

@owen2345
Copy link
Owner

1: About js error: the problem is jquery version (3x deprecated .size() and other methods), pls use jquery-migrate.xx
2: apparently there is a conflict with breadcrumb_on_rails gem, can you verify for a other breadcrumb gem?
Regards!!!

@brian-kephart
Copy link
Collaborator

Perhaps I should have made a separate issue. I commented here because my problem is with the same commit, but it is different than the issue described above. I can't even access the admin portions of my site with the latest version. I see no javascript error because the page doesn't even load.

I'm not using any other breadcrumb gem, just breadcrumbs_on_rails as a dependency of Camaleon.

@owen2345
Copy link
Owner

mmm ok! this weekend I will review with the last version of breadcrumb on rails. Please share me your version of breadcrumb_on_rails gem.

@brian-kephart
Copy link
Collaborator

I'm using breadcrumbs_on_rails v3.0.1. Currently I've locked Camaleon to commit c5c9019 and it works fine, so it's only the most recent change that caused the issue.

@brian-kephart
Copy link
Collaborator

I found the bug causing my issue and submitted a PR. I didn't reference this issue because I'm not sure whether it will affect @kriskoli's issue or not.

There was no issue with breadcrumbs_on_rails. It hasn't changed since last year. Ruby just wasn't parsing the new ternary statement as intended, easily fixed with parentheses.

@kriskoli sorry I hijacked your issue. I thought mine was related, but it appears not.

@kriskoli
Copy link
Author

Hi, owen.
Thank for your help.
I 've changed the .size() method to length for jquery version 3.2.1 on my issue.
It works fine.

@owen2345
Copy link
Owner

Great! pls be careful with other jquery deprecations on 3.x
Note: I solved the breadcrumb issue

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

No branches or pull requests

4 participants