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

clebaudy’s picture

adding : $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

richmck’s picture

Thanks for the heads up. I will test putting this URLENCODE in the php client

cbalan’s picture

Assigned: Unassigned » cbalan
Status: Active » Fixed

Thank you for reporting this.

Patch applied in http://drupal.org/cvs?commit=342028
Closing this ticket.

Thank you,
Catalin Balan

cbalan’s picture

Status: Fixed » Closed (fixed)
jun’s picture

It 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 :

Property: {http://www.alfresco.org/model/content/1.0}name
Constraint: 07181902 Value 'How about this one?' is not valid as a file name. This property must be a valid file name.
   at org.alfresco.repo.node.integrity.IntegrityChecker.checkIntegrity(IntegrityChecker.java:661)

Let me know if you want me to open another issue for that second related problem.

Happy bug chasing,

Jun.

jun’s picture

Version: 6.x-3.0-rc2 » 6.x-3.x-dev
Status: Closed (fixed) » Active

Oops. Forgot to reopen that one and specify it was on the dev version.

sjeandroz’s picture

Hello,

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

cfuller12’s picture

Status: Active » Closed (fixed)

I 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.