Hello,
I am new here and discovering drupal but I think this is a bug.
I installed drupal and alfresco, plus several drupal modules including CMIS, I set my cmis repository to alfresco local install. It works but I have a problem when trying to create an element in repository:
I try to create a folder in the existing folder : User Homes
I get:
* HTTP call to [http://mandriva:8080/alfresco/service/cmis/s/workspace:SpacesStore/arg/p... Homes&filter=&includeAllowableActions=&includePolicyIds=&includeRelationships=&includeACL=&renditionFilter=] returned [505]. Response:
* Error while trying to lookup @object_id
before the create I can see in the PHP code that a lookup is performed on /User Homes, but the space char seems not to be properly encoded (as %20 in the curl action url)
If I do the same operation on /Sites , I manage to create a folder without any problems. So the error comes only when trying to add content to a directory with a space char.
I can browse the dir but not perfom a create on it. A friend told me he had not this problem with deprecated module cmis_alfresco.
Can you confirm me the problem and tell me if there is a solution un next version 7 or it will be one on this version in a next release candidate
thanks
Comments
Comment #1
clebaudy commentedadding : $path = rawurlencode($path);
just before the line : switch($form_state['clicked_button']['#name']) {
in the function cmis_browser_actions_form_submit in file cmis_browser.module fixes the problem for all actions listed.
But I am not a PHP developer (maybe I am becoming one), I do not know anything about your framework (I am learning), I am discovering PHP, drupal and modules so I do not know if it is the way it should be fixed.
As an HTTP GET request is sent to alfresco (in CMIS format) maybe it could be fixed if request was a POST method instead of GET. You will know better, I just try to detail the behaviour and confirm that the space char is not properly encoded. As in previous versions they told me it worked I suppose something like that changed, for me GET requests are easier to debug then POST but I do not care of the kind you wish to use. I did not checked other actions if they also need a fix, you will know.
I tried to create a folder with a space in the name and this is properly handled for new folders. So this fix seems to fix all. I keep it waiting for your feedback or your fix.
See you
Comment #2
richmck commentedThanks for the heads up. I will test putting this URLENCODE in the php client
Comment #3
cbalan commentedThank you for reporting this.
Patch applied in http://drupal.org/cvs?commit=342028
Closing this ticket.
Thank you,
Catalin Balan
Comment #4
cbalan commentedComment #5
jun commentedIt seems that this bug is also present in cmis_sync. Replacing a cmis_folderPath which contains a space character by a cmis_folderId fixes the issue.
In fact the encoding problem seems to occur when the cmis_folderPath contains a space (leading to the same error message above when posting a new content type marked as being synced), but also when syncing nodes with for instance the question mark character '?' leading to Alfresco outputting :
Let me know if you want me to open another issue for that second related problem.
Happy bug chasing,
Jun.
Comment #6
jun commentedOops. Forgot to reopen that one and specify it was on the dev version.
Comment #7
sjeandroz commentedHello,
I think I have the same problem if my folder's name have an accent (é,à,è,.....) but the use of rawurlencode doesn't fix this bug.
Is someone have any idea?
Thanks
Comment #8
cfuller12 commentedI would argue that we now actually have 3 open issues here :)
Regarding spaces in folder names (and nodes) - this is fixed and tested in 6.x-3.x. Creating folders with spaces in either Drupal and Alfresco works via sync and the repository browser.
Regarding special characters, like "?" - these are not valid from a file system standpoint and trying to create an Alfresco node with a question mark also throws an error. We could probably handle this better than just bubbling up the Alfresco error - if you have suggestions, please open another issue and let's work through this separately.
Finally, I've tested creating nodes in both Alfresco and Drupal (and synching) with accented characters and have not been able to reproduce this. All documents were created correctly and preserved the accented characters. Please open a separate issue if you're still having problems with this.