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: undefined method `klass' for false:FalseClass #91

Open
tjsousa opened this issue Apr 20, 2013 · 6 comments
Open

NoMethodError: undefined method `klass' for false:FalseClass #91

tjsousa opened this issue Apr 20, 2013 · 6 comments

Comments

@tjsousa
Copy link
Contributor

tjsousa commented Apr 20, 2013

Got this error when trying to retrieve Contacts from a SugarCRM installation. I'm pretty clueless about this because it seems to work in every other installation I've tried before.

Pretty standard SugarCRM::Contact.all after SugarCRM.connect(...)

NoMethodError: undefined method `klass' for false:FalseClass
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association.rb:81:in `resolve_target'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association.rb:25:in `initialize'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:9:in `new'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:9:in `block in register'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:8:in `each_key'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:8:in `register'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association_methods.rb:63:in `define_association_methods'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:141:in `initialize'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:34:in `new'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:34:in `find'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:96:in `all'
        from (irb):26
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/padrino-core-0.10.7/lib/padrino-core/cli/base.rb:68:in `console'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:109:in `invoke'
        from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/padrino-core-0.10.7/lib/padrino-core/cli/base.rb:73:in `c
@chicks
Copy link
Owner

chicks commented Apr 20, 2013

Hrm... looks like it's choking on resolving an association to the Contacts module. Check that the relationships to Contacts are all okay in Sugar studio.

@tjsousa
Copy link
Contributor Author

tjsousa commented Apr 22, 2013

Unfortunately I have no control of the SugarCRM installation where this is happening as I develop a piece of software that must work with third-party SugarCRM accounts.

But I was able to avoid this error but checking on the module_name result value. Hope this helps :)

@chicks
Copy link
Owner

chicks commented Apr 22, 2013

Even better! Thanks again!

@captivea-ylb
Copy link

I have the same problem for this line
userAssignedSugar = SugarCRM::User.find_by_first_name_and_last_name(userAssigned.firstname.capitalize, userAssigned.lastname.upcase)

I don't understand how tjsousa resolve this issue. You can help me ?

@captivea-ylb
Copy link

I have that too for Account.

@sudeepsnairontash
Copy link

When I try to access Accounts module, it shows an error "undefined method `klass' for false:FalseCla
ss (NoMethodError)" somebody plz help me.
Thanks in advance

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