Closed frugardc closed 13 years ago
No, we use the v2 API which hasn't changed in years, plus this is a runtime exception from Ruby. REST issues generally manifest as an UnhandledException.
Are you passing the wrong number of arguments to one of your methods? The actual set_document_revision call accepts 3 parameters.
It's this method thats failing...
assert SugarCRM.connection.set_document_revision(d.id, d.revision, {:file => file, :file_name => "m_accounts.csv"})
When I change that to...
assert SugarCRM.connection.set_document_revision(d.id, {:file => file, :file_name => "m_accounts.csv"})
all of the tests pass, but the document is not uploaded correctly.
Hrm.. are you using HEAD or 0.9.11?
0.9.11
Let me try 0.9.11 against 6.0.3 Enterprise.
Oh, heh. I just realized that set_document_revision is broken in 0.9.11. It works in HEAD though... Sorry :P
If you want to hotfix it, just copy the set_document_revision.rb file from head... it should work no problem.
Is there any way to do this with Bundler?
If you are using this in a rails environment, you can just modify the project Gemfile to point at the git repo. For system gems, I'm not sure...
Here's the link to the file:
https://github.com/chicks/sugarcrm/blob/master/lib/sugarcrm/connection/api/set_document_revision.rb
I'll cut a gem this weekend.
Erm, copying the file won't work unless you change the session reference after you copy the file...
From: "session": "#{@sugar_session_id}",
To: "session": "#{@session.id}",
I see this works in HEAD. Should it be closed now or wait until the 0.9.12 release?
It can wait until 0.9.12. Better to leave it open in case someone else finds the same problem.
0.9.12 has been released. When you get the chance, can you confirm this version solves the issue?
Just verified it works in 0.9.12. Thanks. Closing.
Loaded suite unit/sugar_document_test Started E Finished in 0.780885 seconds.
1) Error: test: A SugarCRM.connection should Update a document revision. (TestDocumentAttachment): ArgumentError: wrong number of arguments (3 for 2)
1 tests, 1 assertions, 0 failures, 1 errors
Is it possible this is because I am using version 6.0.3? I tried omitting the second argument, which seems to make it work, but I get a "Invalid File Reference" when trying to bring up the document.